home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1999 November / SOTMC_Nov1999-Ultimate.iso / mac / REALbasic ƒ / Examples / Techniques / httpSocket / httpSocket (DR2) < prev    next >
Unknown  |  1999-04-07  |  15.1 KB  |  [CbCl/RBv2]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default
100% TrID PGN (Portable Gaming Notation) Compressed format default (weak)


id metadata
keyvalue
macFileType[CbCl]
macFileCreator[RBv2]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 05 43 6c 61 73 73 0a 68 | 74 74 70 53 6f 63 6b 65 |.Class.h|ttpSocke|
|00000010| 74 3f 31 8b 0b 85 07 07 | 00 0a 68 74 74 70 53 6f |t?1.....|..httpSo|
|00000020| 63 6b 65 74 b4 02 06 53 | 6f 63 6b 65 74 00 24 15 |cket...S|ocket.$.|
|00000030| 47 6f 74 48 65 61 64 65 | 72 73 20 61 73 20 62 6f |GotHeade|rs as bo|
|00000040| 6f 6c 65 61 6e 00 11 48 | 65 61 64 65 72 73 20 61 |olean..H|eaders a|
|00000050| 73 20 73 74 72 69 6e 67 | 00 0e 74 65 78 74 20 61 |s string|..text a|
|00000060| 73 20 73 74 72 69 6e 67 | 00 11 66 69 6c 65 6c 65 |s string|..filele|
|00000070| 6e 20 61 73 20 73 69 6e | 67 6c 65 00 12 66 69 6c |n as sin|gle..fil|
|00000080| 65 74 79 70 65 20 61 73 | 20 73 74 72 69 6e 67 00 |etype as| string.|
|00000090| 16 48 65 61 64 65 72 4e | 61 6d 28 30 29 20 61 73 |.HeaderN|am(0) as|
|000000a0| 20 73 74 72 69 6e 67 00 | 16 48 65 61 64 65 72 56 | string.|.HeaderV|
|000000b0| 61 6c 28 30 29 20 61 73 | 20 73 74 72 69 6e 67 00 |al(0) as| string.|
|000000c0| 12 66 69 6c 65 4e 61 6d | 65 20 61 73 20 73 74 72 |.fileNam|e as str|
|000000d0| 69 6e 67 00 13 4c 61 73 | 74 57 72 69 74 65 20 61 |ing..Las|tWrite a|
|000000e0| 73 20 73 69 6e 67 6c 65 | 00 10 4c 61 73 74 4d 44 |s single|..LastMD|
|000000f0| 20 61 73 20 73 69 6e 67 | 6c 65 00 18 4d 6f 72 65 | as sing|le..More|
|00000100| 44 61 74 61 44 65 6c 61 | 79 20 61 73 20 69 6e 74 |DataDela|y as int|
|00000110| 65 67 65 72 00 16 54 6f | 74 61 6c 4c 65 6e 67 74 |eger..To|talLengt|
|00000120| 68 20 61 73 20 69 6e 74 | 65 67 65 72 00 14 4c 61 |h as int|eger..La|
|00000130| 73 74 41 6d 6f 75 6e 74 | 20 61 73 20 73 69 6e 67 |stAmount| as sing|
|00000140| 6c 65 00 11 44 4c 54 79 | 70 65 20 61 73 20 69 6e |le..DLTy|pe as in|
|00000150| 74 65 67 65 72 00 12 46 | 69 6c 65 20 61 73 20 66 |teger..F|ile as f|
|00000160| 6f 6c 64 65 72 69 74 65 | 6d 00 15 50 72 6f 78 79 |olderite|m..Proxy|
|00000170| 53 65 72 76 65 72 20 61 | 73 20 73 74 72 69 6e 67 |Server a|s string|
|00000180| 00 14 50 72 6f 78 79 50 | 6f 72 74 20 61 73 20 69 |..ProxyP|ort as i|
|00000190| 6e 74 65 67 65 72 00 10 | 43 6c 69 65 6e 74 20 61 |nteger..|Client a|
|000001a0| 73 20 73 74 72 69 6e 67 | 00 11 4c 6f 67 69 6e 36 |s string|..Login6|
|000001b0| 34 20 61 73 20 73 74 72 | 69 6e 67 00 11 63 75 72 |4 as str|ing..cur|
|000001c0| 53 69 74 65 20 61 73 20 | 73 74 72 69 6e 67 00 13 |Site as |string..|
|000001d0| 50 61 73 73 4c 61 73 74 | 20 61 73 20 62 6f 6f 6c |PassLast| as bool|
|000001e0| 65 61 6e 00 11 4d 69 6d | 65 28 30 29 20 61 73 20 |ean..Mim|e(0) as |
|000001f0| 73 74 72 69 6e 67 00 18 | 4d 69 6d 65 43 72 65 61 |string..|MimeCrea|
|00000200| 74 6f 72 28 30 29 20 61 | 73 20 73 74 72 69 6e 67 |tor(0) a|s string|
|00000210| 00 15 4d 69 6d 65 54 79 | 70 65 28 30 29 20 61 73 |..MimeTy|pe(0) as|
|00000220| 20 73 74 72 69 6e 67 00 | 16 4e 75 6d 52 65 66 65 | string.|.NumRefe|
|00000230| 72 65 72 73 20 61 73 20 | 69 6e 74 65 67 65 72 00 |rers as |integer.|
|00000240| 14 42 75 66 66 65 72 53 | 69 7a 65 20 61 73 20 73 |.BufferS|ize as s|
|00000250| 69 6e 67 6c 65 00 16 4c | 6f 67 69 6e 41 6e 64 50 |ingle..L|oginAndP|
|00000260| 61 73 73 20 61 73 20 73 | 74 72 69 6e 67 00 11 4d |ass as s|tring..M|
|00000270| 65 74 68 6f 64 20 61 73 | 20 69 6e 74 65 67 65 72 |ethod as| integer|
|00000280| 00 0e 47 65 74 20 61 73 | 20 69 6e 74 65 67 65 72 |..Get as| integer|
|00000290| 00 0f 50 6f 73 74 20 61 | 73 20 69 6e 74 65 67 65 |..Post a|s intege|
|000002a0| 72 00 14 4b 65 65 70 41 | 6c 69 76 65 20 61 73 20 |r..KeepA|live as |
|000002b0| 62 6f 6f 6c 65 61 6e 00 | 13 43 75 72 53 65 72 76 |boolean.|.CurServ|
|000002c0| 65 72 20 61 73 20 73 74 | 72 69 6e 67 00 12 50 6f |er as st|ring..Po|
|000002d0| 73 74 44 61 74 61 20 61 | 73 20 73 74 72 69 6e 67 |stData a|s string|
|000002e0| 00 15 50 6f 73 74 45 6e | 63 54 79 70 65 20 61 73 |..PostEn|cType as|
|000002f0| 20 73 74 72 69 6e 67 00 | 11 49 6e 69 74 65 64 20 | string.|.Inited |
|00000300| 61 73 20 62 6f 6f 6c 65 | 61 6e 00 14 4e 75 6d 4f |as boole|an..NumO|
|00000310| 66 46 69 72 65 20 61 73 | 20 69 6e 74 65 67 65 72 |fFire as| integer|
|00000320| 00 19 07 67 65 74 48 54 | 54 50 0e 74 55 52 4c 20 |...getHT|TP.tURL |
|00000330| 61 73 20 73 74 72 69 6e | 67 00 00 04 0e 04 0e 1e |as strin|g.......|
|00000340| 1b 53 75 62 20 67 65 74 | 48 54 54 50 28 74 55 52 |.Sub get|HTTP(tUR|
|00000350| 4c 20 61 73 20 73 74 72 | 69 6e 67 29 23 64 69 6d |L as str|ing)#dim|
|00000360| 20 55 52 4c 2c 20 73 65 | 72 76 2c 20 70 61 74 68 | URL, se|rv, path|
|00000370| 2c 20 63 72 6c 66 20 61 | 73 20 73 74 72 69 6e 67 |, crlf a|s string|
|00000380| 00 12 69 66 20 6e 6f 74 | 20 49 6e 69 74 65 64 20 |..if not| Inited |
|00000390| 74 68 65 6e 0e 68 74 74 | 70 53 6f 63 6b 65 74 49 |then.htt|pSocketI|
|000003a0| 6e 69 74 06 65 6e 64 20 | 69 66 00 08 49 6e 69 74 |nit.end |if..Init|
|000003b0| 49 6e 66 6f 00 14 63 72 | 6c 66 3d 63 68 72 28 31 |Info..cr|lf=chr(1|
|000003c0| 33 29 2b 63 68 72 28 31 | 30 29 08 55 52 4c 3d 74 |3)+chr(1|0).URL=t|
|000003d0| 55 52 4c 00 08 6d 65 2e | 43 6c 6f 73 65 00 29 69 |URL..me.|Close.)i|
|000003e0| 66 20 6c 6f 77 65 72 63 | 61 73 65 28 6c 65 66 74 |f lowerc|ase(left|
|000003f0| 28 55 52 4c 2c 20 37 29 | 29 3d 22 68 74 74 70 3a |(URL, 7)|)="http:|
|00000400| 2f 2f 22 20 74 68 65 6e | 0f 55 52 4c 3d 6d 69 64 |//" then|.URL=mid|
|00000410| 28 55 52 4c 2c 20 38 29 | 06 65 6e 64 20 69 66 00 |(URL, 8)|.end if.|
|00000420| 19 69 66 20 69 6e 73 74 | 72 28 55 52 4c 2c 20 22 |.if inst|r(URL, "|
|00000430| 2f 22 29 3e 30 20 74 68 | 65 6e 21 73 65 72 76 3d |/")>0 th|en!serv=|
|00000440| 6c 65 66 74 28 55 52 4c | 2c 20 69 6e 73 74 72 28 |left(URL|, instr(|
|00000450| 55 52 4c 2c 20 22 2f 22 | 29 2d 31 29 1e 70 61 74 |URL, "/"|)-1).pat|
|00000460| 68 3d 6d 69 64 28 55 52 | 4c 2c 20 69 6e 73 74 72 |h=mid(UR|L, instr|
|00000470| 28 55 52 4c 2c 20 22 2f | 22 29 29 04 65 6c 73 65 |(URL, "/|")).else|
|00000480| 08 73 65 72 76 3d 55 52 | 4c 08 70 61 74 68 3d 22 |.serv=UR|L.path="|
|00000490| 2f 22 06 65 6e 64 20 69 | 66 00 0c 63 75 72 53 69 |/".end i|f..curSi|
|000004a0| 74 65 3d 74 55 52 4c 14 | 44 6f 43 6f 6e 6e 65 63 |te=tURL.|DoConnec|
|000004b0| 74 20 73 65 72 76 2c 20 | 70 61 74 68 00 07 45 6e |t serv, |path..En|
|000004c0| 64 20 53 75 62 08 49 6e | 69 74 49 6e 66 6f 00 00 |d Sub.In|itInfo..|
|000004d0| 00 02 0e 02 0e 11 0e 53 | 75 62 20 49 6e 69 74 49 |.......S|ub InitI|
|000004e0| 6e 66 6f 28 29 12 69 66 | 20 6e 6f 74 20 49 6e 69 |nfo().if| not Ini|
|000004f0| 74 65 64 20 74 68 65 6e | 0e 68 74 74 70 53 6f 63 |ted then|.httpSoc|
|00000500| 6b 65 74 49 6e 69 74 06 | 65 6e 64 20 69 66 00 10 |ketInit.|end if..|
|00000510| 47 6f 74 48 65 61 64 65 | 72 73 3d 66 61 6c 73 65 |GotHeade|rs=false|
|00000520| 09 66 69 6c 65 6c 65 6e | 3d 30 0b 66 69 6c 65 74 |.filelen|=0.filet|
|00000530| 79 70 65 3d 22 22 0a 48 | 65 61 64 65 72 73 3d 22 |ype="".H|eaders="|
|00000540| 22 12 72 65 64 69 6d 20 | 48 65 61 64 65 72 4e 61 |".redim |HeaderNa|
|00000550| 6d 28 30 29 12 72 65 64 | 69 6d 20 48 65 61 64 65 |m(0).red|im Heade|
|00000560| 72 56 61 6c 28 30 29 07 | 74 65 78 74 3d 22 22 0c |rVal(0).|text="".|
|00000570| 4c 61 73 74 41 6d 6f 75 | 6e 74 3d 30 08 4c 61 73 |LastAmou|nt=0.Las|
|00000580| 74 4d 44 3d 30 0d 54 6f | 74 61 6c 4c 65 6e 67 74 |tMD=0.To|talLengt|
|00000590| 68 3d 30 0d 6e 75 6d 72 | 65 66 65 72 65 72 73 3d |h=0.numr|eferers=|
|000005a0| 30 07 45 6e 64 20 53 75 | 62 0c 41 64 64 54 6f 48 |0.End Su|b.AddToH|
|000005b0| 65 61 64 65 72 73 0c 74 | 73 20 61 73 20 73 74 72 |eaders.t|s as str|
|000005c0| 69 6e 67 00 00 04 0e 04 | 0e 35 1e 53 75 62 20 41 |ing.....|.5.Sub A|
|000005d0| 64 64 54 6f 48 65 61 64 | 65 72 73 28 74 73 20 61 |ddToHead|ers(ts a|
|000005e0| 73 20 73 74 72 69 6e 67 | 29 24 64 69 6d 20 72 2c |s string|)$dim r,|
|000005f0| 20 74 20 61 73 20 73 74 | 72 69 6e 67 2c 20 66 62 | t as st|ring, fb|
|00000600| 6f 6f 6c 20 61 73 20 62 | 6f 6f 6c 65 61 6e 00 12 |ool as b|oolean..|
|00000610| 69 66 20 6e 6f 74 20 49 | 6e 69 74 65 64 20 74 68 |if not I|nited th|
|00000620| 65 6e 0e 68 74 74 70 53 | 6f 63 6b 65 74 49 6e 69 |en.httpS|ocketIni|
|00000630| 74 06 65 6e 64 20 69 66 | 00 04 74 3d 74 73 00 1b |t.end if|..t=ts..|
|00000640| 69 66 20 69 6e 73 74 72 | 28 74 2c 20 63 68 72 28 |if instr|(t, chr(|
|00000650| 31 33 29 29 3d 30 20 74 | 68 65 6e 29 74 3d 72 65 |13))=0 t|hen)t=re|
|00000660| 70 6c 61 63 65 61 6c 6c | 28 74 2c 20 63 68 72 28 |placeall|(t, chr(|
|00000670| 31 30 29 2c 20 63 68 72 | 28 31 33 29 2b 63 68 72 |10), chr|(13)+chr|
|00000680| 28 31 30 29 29 0a 66 62 | 6f 6f 6c 3d 74 72 75 65 |(10)).fb|ool=true|
|00000690| 06 65 6e 64 20 69 66 00 | 2b 69 66 20 69 6e 73 74 |.end if.|+if inst|
|000006a0| 72 28 74 2c 20 63 68 72 | 28 31 30 29 2b 63 68 72 |r(t, chr|(10)+chr|
|000006b0| 28 31 33 29 2b 63 68 72 | 28 31 30 29 29 3e 30 20 |(13)+chr|(10))>0 |
|000006c0| 74 68 65 6e 0f 47 6f 74 | 48 65 61 64 65 72 73 3d |then.Got|Headers=|
|000006d0| 74 72 75 65 26 68 65 61 | 64 65 72 73 3d 68 65 61 |true&hea|ders=hea|
|000006e0| 64 65 72 73 2b 6c 65 66 | 74 28 74 2c 20 47 65 74 |ders+lef|t(t, Get|
|000006f0| 44 72 6f 70 4f 66 66 28 | 74 29 29 17 72 3d 6d 69 |DropOff(|t)).r=mi|
|00000700| 64 28 74 2c 20 47 65 74 | 44 72 6f 70 4f 66 66 28 |d(t, Get|DropOff(|
|00000710| 74 29 29 0c 50 61 72 73 | 65 48 65 61 64 65 72 73 |t)).Pars|eHeaders|
|00000720| 0d 69 66 20 66 62 6f 6f | 6c 20 74 68 65 6e 31 41 |.if fboo|l then1A|
|00000730| 64 64 54 6f 46 69 6c 65 | 20 72 65 70 6c 61 63 65 |ddToFile| replace|
|00000740| 61 6c 6c 28 72 2c 20 63 | 68 72 28 31 33 29 2b 63 |all(r, c|hr(13)+c|
|00000750| 68 72 28 31 30 29 2c 20 | 63 68 72 28 31 30 29 29 |hr(10), |chr(10))|
|00000760| 04 65 6c 73 65 0b 41 64 | 64 54 6f 46 69 6c 65 20 |.else.Ad|dToFile |
|00000770| 72 06 65 6e 64 20 69 66 | 04 65 6c 73 65 11 68 65 |r.end if|.else.he|
|00000780| 61 64 65 72 73 3d 68 65 | 61 64 65 72 73 2b 74 06 |aders=he|aders+t.|
|00000790| 65 6e 64 20 69 66 00 25 | 27 64 69 6d 20 72 2c 20 |end if.%|'dim r, |
|000007a0| 74 20 61 73 20 73 74 72 | 69 6e 67 2c 20 66 62 6f |t as str|ing, fbo|
|000007b0| 6f 6c 20 61 73 20 62 6f | 6f 6c 65 61 6e 00 06 72 |ol as bo|olean..r|
|000007c0| 65 74 75 72 6e 00 04 74 | 3d 74 73 1b 2f 2f 66 69 |eturn..t|=ts.//fi|
|000007d0| 72 73 74 2c 20 67 65 74 | 20 72 69 64 20 6f 66 20 |rst, get| rid of |
|000007e0| 61 6c 6c 20 43 52 73 1a | 74 3d 72 65 70 6c 61 63 |all CRs.|t=replac|
|000007f0| 65 61 6c 6c 28 74 2c 63 | 68 72 28 31 33 29 2c 22 |eall(t,c|hr(13),"|
|00000800| 22 29 1e 2f 2f 20 74 68 | 65 6e 20 72 65 70 6c 61 |").// th|en repla|
|00000810| 63 65 20 4c 46 73 20 77 | 69 74 68 20 43 52 4c 46 |ce LFs w|ith CRLF|
|00000820| 73 29 74 3d 72 65 70 6c | 61 63 65 61 6c 6c 28 74 |s)t=repl|aceall(t|
|00000830| 2c 20 63 68 72 28 31 30 | 29 2c 20 63 68 72 28 31 |, chr(10|), chr(1|
|00000840| 33 29 2b 63 68 72 28 31 | 30 29 29 0a 66 62 6f 6f |3)+chr(1|0)).fboo|
|00000850| 6c 3d 74 72 75 65 00 2d | 69 66 20 28 69 6e 73 74 |l=true.-|if (inst|
|00000860| 72 28 74 2c 20 63 68 72 | 28 31 30 29 2b 63 68 72 |r(t, chr|(10)+chr|
|00000870| 28 31 33 29 2b 63 68 72 | 28 31 30 29 29 3e 30 29 |(13)+chr|(10))>0)|
|00000880| 20 74 68 65 6e 0f 47 6f | 74 48 65 61 64 65 72 73 | then.Go|tHeaders|
|00000890| 3d 74 72 75 65 26 68 65 | 61 64 65 72 73 3d 68 65 |=true&he|aders=he|
|000008a0| 61 64 65 72 73 2b 6c 65 | 66 74 28 74 2c 20 47 65 |aders+le|ft(t, Ge|
|000008b0| 74 44 72 6f 70 4f 66 66 | 28 74 29 29 17 72 3d 6d |tDropOff|(t)).r=m|
|000008c0| 69 64 28 74 2c 20 47 65 | 74 44 72 6f 70 4f 66 66 |id(t, Ge|tDropOff|
|000008d0| 28 74 29 29 0c 50 61 72 | 73 65 48 65 61 64 65 72 |(t)).Par|seHeader|
|000008e0| 73 0d 69 66 20 66 62 6f | 6f 6c 20 74 68 65 6e 31 |s.if fbo|ol then1|
|000008f0| 41 64 64 54 6f 46 69 6c | 65 20 72 65 70 6c 61 63 |AddToFil|e replac|
|00000900| 65 61 6c 6c 28 72 2c 20 | 63 68 72 28 31 33 29 2b |eall(r, |chr(13)+|
|00000910| 63 68 72 28 31 30 29 2c | 20 63 68 72 28 31 30 29 |chr(10),| chr(10)|
|00000920| 29 04 65 6c 73 65 0b 41 | 64 64 54 6f 46 69 6c 65 |).else.A|ddToFile|
|00000930| 20 72 06 65 6e 64 20 69 | 66 04 65 6c 73 65 11 68 | r.end i|f.else.h|
|00000940| 65 61 64 65 72 73 3d 68 | 65 61 64 65 72 73 2b 74 |eaders=h|eaders+t|
|00000950| 06 65 6e 64 20 69 66 07 | 45 6e 64 20 53 75 62 0c |.end if.|End Sub.|
|00000960| 50 61 72 73 65 48 65 61 | 64 65 72 73 00 00 00 05 |ParseHea|ders....|
|00000970| 0e 05 0e 34 12 53 75 62 | 20 50 61 72 73 65 48 65 |...4.Sub| ParseHe|
|00000980| 61 64 65 72 73 28 29 3a | 64 69 6d 20 74 2c 20 6e |aders():|dim t, n|
|00000990| 2c 20 76 2c 20 6e 55 52 | 4c 20 61 73 20 73 74 72 |, v, nUR|L as str|
|000009a0| 69 6e 67 2c 20 71 20 61 | 73 20 62 6f 6f 6c 65 61 |ing, q a|s boolea|
|000009b0| 6e 2c 20 49 2c 20 70 20 | 61 73 20 69 6e 74 65 67 |n, I, p |as integ|
|000009c0| 65 72 19 64 69 6d 20 63 | 20 61 73 20 74 65 78 74 |er.dim c| as text|
|000009d0| 6f 75 74 70 75 74 73 74 | 72 65 61 6d 00 12 69 66 |outputst|ream..if|
|000009e0| 20 6e 6f 74 20 49 6e 69 | 74 65 64 20 74 68 65 6e | not Ini|ted then|
|000009f0| 0e 68 74 74 70 53 6f 63 | 6b 65 74 49 6e 69 74 06 |.httpSoc|ketInit.|
|00000a00| 65 6e 64 20 69 66 00 28 | 48 65 61 64 65 72 73 3d |end if.(|Headers=|
|00000a10| 72 65 70 6c 61 63 65 61 | 6c 6c 28 68 65 61 64 65 |replacea|ll(heade|
|00000a20| 72 73 2c 20 63 68 72 28 | 31 30 29 2c 20 22 22 29 |rs, chr(|10), "")|
|00000a30| 00 2a 46 6f 72 20 49 20 | 3d 20 32 20 74 6f 20 63 |.*For I |= 2 to c|
|00000a40| 6f 75 6e 74 46 69 65 6c | 64 73 28 48 65 61 64 65 |ountFiel|ds(Heade|
|00000a50| 72 73 2c 20 63 68 72 28 | 31 33 29 29 00 38 74 3d |rs, chr(|13)).8t=|
|00000a60| 72 65 70 6c 61 63 65 61 | 6c 6c 28 6e 74 68 46 69 |replacea|ll(nthFi|
|00000a70| 65 6c 64 28 48 65 61 64 | 65 72 73 2c 20 63 68 72 |eld(Head|ers, chr|
|00000a80| 28 31 33 29 2c 20 49 29 | 2c 20 63 68 72 28 31 30 |(13), I)|, chr(10|
|00000a90| 29 2c 20 22 22 29 15 6e | 3d 6e 74 68 46 69 65 6c |), "").n|=nthFiel|
|00000aa0| 64 28 74 2c 20 22 3a 22 | 2c 20 31 29 19 76 3d 6d |d(t, ":"|, 1).v=m|
|00000ab0| 69 64 28 74 2c 20 69 6e | 73 74 72 28 74 2c 20 22 |id(t, in|str(t, "|
|00000ac0| 3a 22 29 2b 31 29 12 48 | 65 61 64 65 72 4e 61 6d |:")+1).H|eaderNam|
|00000ad0| 2e 41 70 70 65 6e 64 20 | 6e 12 48 65 61 64 65 72 |.Append |n.Header|
|00000ae0| 56 61 6c 2e 41 70 70 65 | 6e 64 20 76 0d 73 65 6c |Val.Appe|nd v.sel|
|00000af0| 65 63 74 20 63 61 73 65 | 20 6e 15 63 61 73 65 20 |ect case| n.case |
|00000b00| 22 43 6f 6e 74 65 6e 74 | 2d 4c 65 6e 67 74 68 22 |"Content|-Length"|
|00000b10| 12 74 6f 74 61 6c 6c 65 | 6e 67 74 68 3d 76 61 6c |.totalle|ngth=val|
|00000b20| 28 76 29 13 63 61 73 65 | 20 22 43 6f 6e 74 65 6e |(v).case| "Conten|
|00000b30| 74 2d 54 79 70 65 22 10 | 66 69 6c 65 74 79 70 65 |t-Type".|filetype|
|00000b40| 3d 74 72 69 6d 28 76 29 | 00 0f 63 61 73 65 20 22 |=trim(v)|..case "|
|00000b50| 4c 6f 63 61 74 69 6f 6e | 22 06 6e 55 52 4c 3d 76 |Location|".nURL=v|
|00000b60| 00 17 63 61 73 65 20 22 | 57 57 57 2d 41 75 74 68 |..case "|WWW-Auth|
|00000b70| 65 6e 74 69 63 61 74 65 | 22 10 6c 6f 67 69 6e 36 |enticate|".login6|
|00000b80| 34 3d 73 74 52 28 49 2d | 31 29 00 0a 65 6e 64 20 |4=stR(I-|1)..end |
|00000b90| 73 65 6c 65 63 74 00 04 | 6e 65 78 74 00 0f 52 65 |select..|next..Re|
|00000ba0| 63 65 69 76 65 64 48 65 | 61 64 65 72 73 00 10 69 |ceivedHe|aders..i|
|00000bb0| 66 20 6e 55 52 4c 3c 3e | 22 22 20 74 68 65 6e 08 |f nURL<>|"" then.|
|00000bc0| 6d 65 2e 43 6c 6f 73 65 | 15 63 3d 66 69 6c 65 2e |me.Close|.c=file.|
|00000bd0| 43 72 65 61 74 65 54 65 | 78 74 66 69 6c 65 07 63 |CreateTe|xtfile.c|
|00000be0| 2e 63 6c 6f 73 65 0f 6e | 55 52 4c 3d 74 72 69 6d |.close.n|URL=trim|
|00000bf0| 28 6e 55 52 4c 29 19 6e | 75 6d 72 65 66 65 72 65 |(nURL).n|umrefere|
|00000c00| 72 73 3d 6e 75 6d 72 65 | 66 65 72 65 72 73 2b 31 |rs=numre|ferers+1|
|00000c10| 0d 49 3d 6e 75 6d 72 65 | 66 65 72 65 72 73 0c 69 |.I=numre|ferers.i|
|00000c20| 66 20 69 3c 3d 36 20 74 | 68 65 6e 17 47 65 74 48 |f i<=6 t|hen.GetH|
|00000c30| 54 54 50 20 46 6f 72 6d | 61 74 55 52 4c 28 6e 55 |TTP Form|atURL(nU|
|00000c40| 52 4c 29 1f 4c 6f 63 61 | 74 69 6f 6e 43 68 61 6e |RL).Loca|tionChan|
|00000c50| 67 65 64 20 46 6f 72 6d | 61 74 55 52 4c 28 6e 55 |ged Form|atURL(nU|
|00000c60| 52 4c 29 0d 6e 75 6d 72 | 65 66 65 72 65 72 73 3d |RL).numr|eferers=|
|00000c70| 69 04 65 6c 73 65 09 43 | 61 6e 63 65 6c 6c 65 64 |i.else.C|ancelled|
|00000c80| 0d 6e 75 6d 72 65 66 65 | 72 65 72 73 3d 30 06 65 |.numrefe|rers=0.e|
|00000c90| 6e 64 20 69 66 06 65 6e | 64 20 69 66 07 45 6e 64 |nd if.en|d if.End|
|00000ca0| 20 53 75 62 09 41 64 64 | 54 6f 46 69 6c 65 0b 74 | Sub.Add|ToFile.t|
|00000cb0| 20 61 73 20 73 74 72 69 | 6e 67 00 00 05 0e 05 0e | as stri|ng......|
|00000cc0| 1c 1a 53 75 62 20 41 64 | 64 54 6f 46 69 6c 65 28 |..Sub Ad|dToFile(|
|00000cd0| 74 20 61 73 20 73 74 72 | 69 6e 67 29 1f 64 69 6d |t as str|ing).dim|
|00000ce0| 20 62 70 73 20 61 73 20 | 73 69 6e 67 6c 65 2c 20 | bps as |single, |
|00000cf0| 74 72 20 61 73 20 73 69 | 6e 67 6c 65 19 64 69 6d |tr as si|ngle.dim|
|00000d00| 20 66 20 61 73 20 74 65 | 78 74 6f 75 74 70 75 74 | f as te|xtoutput|
|00000d10| 73 74 72 65 61 6d 00 12 | 69 66 20 6e 6f 74 20 49 |stream..|if not I|
|00000d20| 6e 69 74 65 64 20 74 68 | 65 6e 0e 68 74 74 70 53 |nited th|en.httpS|
|00000d30| 6f 63 6b 65 74 49 6e 69 | 74 06 65 6e 64 20 69 66 |ocketIni|t.end if|
|00000d40| 00 0b 74 65 78 74 3d 74 | 65 78 74 2b 74 00 16 66 |..text=t|ext+t..f|
|00000d50| 69 6c 65 6c 65 6e 3d 66 | 69 6c 65 6c 65 6e 2b 6c |ilelen=f|ilelen+l|
|00000d60| 65 6e 28 74 29 00 23 69 | 66 20 54 69 63 6b 73 2d |en(t).#i|f Ticks-|
|00000d70| 4c 61 73 74 4d 44 3e 3d | 4d 6f 72 65 44 61 74 61 |LastMD>=|MoreData|
|00000d80| 44 65 6c 61 79 20 74 68 | 65 6e 2c 62 70 73 3d 28 |Delay th|en,bps=(|
|00000d90| 66 69 6c 65 6c 65 6e 2d | 4c 61 73 74 41 6d 6f 75 |filelen-|LastAmou|
|00000da0| 6e 74 29 2f 28 28 54 69 | 63 6b 73 2d 4c 61 73 74 |nt)/((Ti|cks-Last|
|00000db0| 4d 44 29 2f 36 30 29 12 | 4c 61 73 74 41 6d 6f 75 |MD)/60).|LastAmou|
|00000dc0| 6e 74 3d 66 69 6c 65 6c | 65 6e 0c 4c 61 73 74 4d |nt=filel|en.LastM|
|00000dd0| 44 3d 74 69 63 6b 73 00 | 37 4d 6f 72 65 44 61 74 |D=ticks.|7MoreDat|
|00000de0| 61 20 66 69 6c 65 6c 65 | 6e 2c 20 74 6f 74 61 6c |a filele|n, total|
|00000df0| 4c 65 6e 67 74 68 2c 20 | 66 69 6c 65 6c 65 6e 2f |Length, |filelen/|
|00000e00| 74 6f 74 61 6c 4c 65 6e | 67 74 68 2c 20 62 70 73 |totalLen|gth, bps|
|00000e10| 06 65 6e 64 20 69 66 00 | 1c 69 66 20 6c 65 6e 28 |.end if.|.if len(|
|00000e20| 74 65 78 74 29 3e 42 75 | 66 66 65 72 53 69 7a 65 |text)>Bu|fferSize|
|00000e30| 20 74 68 65 6e 1f 2f 2f | 20 57 72 69 74 65 20 69 | then.//| Write i|
|00000e40| 6e 20 75 73 65 72 2d 64 | 65 66 69 6e 65 64 20 63 |n user-d|efined c|
|00000e50| 68 75 6e 6b 73 17 66 3d | 66 69 6c 65 2e 41 70 70 |hunks.f=|file.App|
|00000e60| 65 6e 64 54 6f 54 65 78 | 74 46 69 6c 65 0c 66 2e |endToTex|tFile.f.|
|00000e70| 57 72 69 74 65 20 74 65 | 78 74 07 66 2e 43 6c 6f |Write te|xt.f.Clo|
|00000e80| 73 65 07 74 65 78 74 3d | 22 22 06 65 6e 64 20 69 |se.text=|"".end i|
|00000e90| 66 07 45 6e 64 20 53 75 | 62 0a 47 65 74 44 72 6f |f.End Su|b.GetDro|
|00000ea0| 70 4f 66 66 0b 74 20 61 | 73 20 73 74 72 69 6e 67 |pOff.t a|s string|
|00000eb0| 07 69 6e 74 65 67 65 72 | 00 04 0e 04 0e 17 2b 46 |.integer|......+F|
|00000ec0| 75 6e 63 74 69 6f 6e 20 | 47 65 74 44 72 6f 70 4f |unction |GetDropO|
|00000ed0| 66 66 28 74 20 61 73 20 | 73 74 72 69 6e 67 29 20 |ff(t as |string) |
|00000ee0| 41 73 20 69 6e 74 65 67 | 65 72 20 64 69 6d 20 49 |As integ|er dim I|
|00000ef0| 2c 20 6e 20 61 73 20 69 | 6e 74 65 67 65 72 2c 20 |, n as i|nteger, |
|00000f00| 6c 20 61 73 20 73 74 72 | 69 6e 67 00 12 69 66 20 |l as str|ing..if |
|00000f10| 6e 6f 74 20 49 6e 69 74 | 65 64 20 74 68 65 6e 0e |not Init|ed then.|
|00000f20| 68 74 74 70 53 6f 63 6b | 65 74 49 6e 69 74 06 65 |httpSock|etInit.e|
|00000f30| 6e 64 20 69 66 00 03 6e | 3d 30 00 0b 69 66 20 6e |nd if..n|=0..if n|
|00000f40| 3d 31 20 74 68 65 6e 24 | 46 6f 72 20 49 20 3d 20 |=1 then$|For I = |
|00000f50| 31 20 74 6f 20 63 6f 75 | 6e 74 46 69 65 6c 64 73 |1 to cou|ntFields|
|00000f60| 28 74 2c 20 63 68 72 28 | 31 33 29 29 19 6c 3d 6e |(t, chr(|13)).l=n|
|00000f70| 74 68 46 69 65 6c 64 28 | 74 2c 20 63 68 72 28 31 |thField(|t, chr(1|
|00000f80| 33 29 2c 20 49 29 24 69 | 66 20 6c 65 66 74 28 6c |3), I)$i|f left(l|
|00000f90| 2c 20 31 34 29 3d 22 43 | 6f 6e 74 65 6e 74 2d 54 |, 14)="C|ontent-T|
|00000fa0| 79 70 65 3a 20 22 20 74 | 68 65 6e 00 1b 72 65 74 |ype: " t|hen..ret|
|00000fb0| 75 72 6e 20 69 6e 73 74 | 72 28 74 2c 20 6c 29 2b |urn inst|r(t, l)+|
|00000fc0| 6c 65 6e 28 6c 29 2b 32 | 06 65 6e 64 20 69 66 04 |len(l)+2|.end if.|
|00000fd0| 6e 65 78 74 00 0f 65 6c | 73 65 69 66 20 6e 3d 30 |next..el|seif n=0|
|00000fe0| 20 74 68 65 6e 23 6e 3d | 69 6e 73 74 72 28 74 2c | then#n=|instr(t,|
|00000ff0| 20 63 68 72 28 31 30 29 | 2b 63 68 72 28 31 33 29 | chr(10)|+chr(13)|
|00001000| 2b 63 68 72 28 31 30 29 | 29 0a 72 65 74 75 72 6e |+chr(10)|).return|
|00001010| 20 6e 2b 33 06 65 6e 64 | 20 69 66 0c 45 6e 64 20 | n+3.end| if.End |
|00001020| 46 75 6e 63 74 69 6f 6e | 09 46 6f 72 6d 61 74 55 |Function|.FormatU|
|00001030| 52 4c 0e 74 55 52 4c 20 | 61 73 20 73 74 72 69 6e |RL.tURL |as strin|
|00001040| 67 06 73 74 72 69 6e 67 | 00 04 0e 04 0e 17 2c 46 |g.string|......,F|
|00001050| 75 6e 63 74 69 6f 6e 20 | 46 6f 72 6d 61 74 55 52 |unction |FormatUR|
|00001060| 4c 28 74 55 52 4c 20 61 | 73 20 73 74 72 69 6e 67 |L(tURL a|s string|
|00001070| 29 20 41 73 20 73 74 72 | 69 6e 67 1d 64 69 6d 20 |) As str|ing.dim |
|00001080| 55 52 4c 2c 20 73 65 72 | 76 2c 20 70 61 74 68 20 |URL, ser|v, path |
|00001090| 61 73 20 73 74 72 69 6e | 67 00 12 69 66 20 6e 6f |as strin|g..if no|
|000010a0| 74 20 49 6e 69 74 65 64 | 20 74 68 65 6e 0e 68 74 |t Inited| then.ht|
|000010b0| 74 70 53 6f 63 6b 65 74 | 49 6e 69 74 06 65 6e 64 |tpSocket|Init.end|
|000010c0| 20 69 66 00 08 55 52 4c | 3d 74 55 52 4c 00 29 69 | if..URL|=tURL.)i|
|000010d0| 66 20 6c 6f 77 65 72 63 | 61 73 65 28 6c 65 66 74 |f lowerc|ase(left|
|000010e0| 28 55 52 4c 2c 20 37 29 | 29 3d 22 68 74 74 70 3a |(URL, 7)|)="http:|
|000010f0| 2f 2f 22 20 74 68 65 6e | 0f 55 52 4c 3d 6d 69 64 |//" then|.URL=mid|
|00001100| 28 55 52 4c 2c 20 38 29 | 06 65 6e 64 20 69 66 00 |(URL, 8)|.end if.|
|00001110| 19 69 66 20 69 6e 73 74 | 72 28 55 52 4c 2c 20 22 |.if inst|r(URL, "|
|00001120| 2f 22 29 3e 30 20 74 68 | 65 6e 21 73 65 72 76 3d |/")>0 th|en!serv=|
|00001130| 6c 65 66 74 28 55 52 4c | 2c 20 69 6e 73 74 72 28 |left(URL|, instr(|
|00001140| 55 52 4c 2c 20 22 2f 22 | 29 2d 31 29 1e 70 61 74 |URL, "/"|)-1).pat|
|00001150| 68 3d 6d 69 64 28 55 52 | 4c 2c 20 69 6e 73 74 72 |h=mid(UR|L, instr|
|00001160| 28 55 52 4c 2c 20 22 2f | 22 29 29 04 65 6c 73 65 |(URL, "/|")).else|
|00001170| 08 73 65 72 76 3d 55 52 | 4c 08 70 61 74 68 3d 22 |.serv=UR|L.path="|
|00001180| 2f 22 06 65 6e 64 20 69 | 66 00 1a 72 65 74 75 72 |/".end i|f..retur|
|00001190| 6e 20 22 68 74 74 70 3a | 2f 2f 22 2b 73 65 72 76 |n "http:|//"+serv|
|000011a0| 2b 70 61 74 68 0c 45 6e | 64 20 46 75 6e 63 74 69 |+path.En|d Functi|
|000011b0| 6f 6e 07 47 65 74 46 69 | 6c 65 0e 74 55 52 4c 20 |on.GetFi|le.tURL |
|000011c0| 61 73 20 73 74 72 69 6e | 67 00 00 06 00 06 00 1d |as strin|g.......|
|000011d0| 1b 53 75 62 20 47 65 74 | 46 69 6c 65 28 74 55 52 |.Sub Get|File(tUR|
|000011e0| 4c 20 61 73 20 73 74 72 | 69 6e 67 29 21 64 69 6d |L as str|ing)!dim|
|000011f0| 20 66 20 61 73 20 66 6f | 6c 64 65 72 69 74 65 6d | f as fo|lderitem|
|00001200| 2c 20 49 20 61 73 20 69 | 6e 74 65 67 65 72 00 12 |, I as i|nteger..|
|00001210| 69 66 20 6e 6f 74 20 49 | 6e 69 74 65 64 20 74 68 |if not I|nited th|
|00001220| 65 6e 0e 68 74 74 70 53 | 6f 63 6b 65 74 49 6e 69 |en.httpS|ocketIni|
|00001230| 74 06 65 6e 64 20 69 66 | 00 11 66 3d 54 65 6d 70 |t.end if|..f=Temp|
|00001240| 6f 72 61 72 79 46 6f 6c | 64 65 72 05 49 20 3d 20 |oraryFol|der.I = |
|00001250| 31 00 02 44 6f 2e 69 66 | 20 6e 6f 74 20 66 2e 43 |1..Do.if| not f.C|
|00001260| 68 69 6c 64 28 22 52 42 | 20 48 54 54 50 20 23 22 |hild("RB| HTTP #"|
|00001270| 2b 73 74 72 28 49 29 29 | 2e 45 78 69 73 74 73 20 |+str(I))|.Exists |
|00001280| 74 68 65 6e 04 65 78 69 | 74 06 65 6e 64 20 69 66 |then.exi|t.end if|
|00001290| 05 49 3d 49 2b 31 04 6c | 6f 6f 70 00 1d 66 3d 66 |.I=I+1.l|oop..f=f|
|000012a0| 2e 43 68 69 6c 64 28 22 | 52 42 20 48 54 54 50 20 |.Child("|RB HTTP |
|000012b0| 23 22 2b 73 74 72 28 49 | 29 29 00 06 46 69 6c 65 |#"+str(I|))..File|
|000012c0| 3d 46 00 18 49 66 20 4c | 6f 67 69 6e 41 6e 64 50 |=F..If L|oginAndP|
|000012d0| 61 73 73 3c 3e 22 22 20 | 74 68 65 6e 1f 4c 6f 67 |ass<>"" |then.Log|
|000012e0| 69 6e 36 34 3d 47 65 74 | 42 61 73 65 36 34 28 4c |in64=Get|Base64(L|
|000012f0| 6f 67 69 6e 41 6e 64 50 | 61 73 73 29 0f 4c 6f 67 |oginAndP|ass).Log|
|00001300| 69 6e 41 6e 64 50 61 73 | 73 3d 22 22 06 65 6e 64 |inAndPas|s="".end|
|00001310| 20 69 66 00 08 44 4c 54 | 79 70 65 3d 31 0c 47 65 | if..DLT|ype=1.Ge|
|00001320| 74 48 54 54 50 20 74 55 | 52 4c 07 45 6e 64 20 53 |tHTTP tU|RL.End S|
|00001330| 75 62 08 44 6f 77 6e 6c | 6f 61 64 1e 55 52 4c 20 |ub.Downl|oad.URL |
|00001340| 61 73 20 73 74 72 69 6e | 67 2c 20 66 20 61 73 20 |as strin|g, f as |
|00001350| 66 6f 6c 64 65 72 69 74 | 65 6d 00 00 02 0e 02 0e |folderit|em......|
|00001360| 0e 2c 53 75 62 20 44 6f | 77 6e 6c 6f 61 64 28 55 |.,Sub Do|wnload(U|
|00001370| 52 4c 20 61 73 20 73 74 | 72 69 6e 67 2c 20 66 20 |RL as st|ring, f |
|00001380| 61 73 20 66 6f 6c 64 65 | 72 69 74 65 6d 29 12 69 |as folde|ritem).i|
|00001390| 66 20 6e 6f 74 20 49 6e | 69 74 65 64 20 74 68 65 |f not In|ited the|
|000013a0| 6e 0e 68 74 74 70 53 6f | 63 6b 65 74 49 6e 69 74 |n.httpSo|cketInit|
|000013b0| 06 65 6e 64 20 69 66 00 | 18 49 66 20 4c 6f 67 69 |.end if.|.If Logi|
|000013c0| 6e 41 6e 64 50 61 73 73 | 3c 3e 22 22 20 74 68 65 |nAndPass|<>"" the|
|000013d0| 6e 1f 4c 6f 67 69 6e 36 | 34 3d 47 65 74 42 61 73 |n.Login6|4=GetBas|
|000013e0| 65 36 34 28 4c 6f 67 69 | 6e 41 6e 64 50 61 73 73 |e64(Logi|nAndPass|
|000013f0| 29 0f 4c 6f 67 69 6e 41 | 6e 64 50 61 73 73 3d 22 |).LoginA|ndPass="|
|00001400| 22 06 65 6e 64 20 69 66 | 00 06 66 69 6c 65 3d 66 |".end if|..file=f|
|00001410| 08 44 4c 54 79 70 65 3d | 30 0b 47 65 74 48 54 54 |.DLType=|0.GetHTT|
|00001420| 50 20 55 52 4c 07 45 6e | 64 20 53 75 62 09 44 6f |P URL.En|d Sub.Do|
|00001430| 43 6f 6e 6e 65 63 74 1e | 73 65 72 76 20 61 73 20 |Connect.|serv as |
|00001440| 73 74 72 69 6e 67 2c 20 | 70 61 74 68 20 61 73 20 |string, |path as |
|00001450| 73 74 72 69 6e 67 00 00 | 05 0e 05 0e a1 01 2d 53 |string..|......-S|
|00001460| 75 62 20 44 6f 43 6f 6e | 6e 65 63 74 28 73 65 72 |ub DoCon|nect(ser|
|00001470| 76 20 61 73 20 73 74 72 | 69 6e 67 2c 20 70 61 74 |v as str|ing, pat|
|00001480| 68 20 61 73 20 73 74 72 | 69 6e 67 29 18 64 69 6d |h as str|ing).dim|
|00001490| 20 63 72 6c 66 2c 20 68 | 6f 73 74 20 61 73 20 73 | crlf, h|ost as s|
|000014a0| 74 72 69 6e 67 14 63 72 | 6c 66 3d 63 68 72 28 31 |tring.cr|lf=chr(1|
|000014b0| 33 29 2b 63 68 72 28 31 | 30 29 00 12 69 66 20 6e |3)+chr(1|0)..if n|
|000014c0| 6f 74 20 49 6e 69 74 65 | 64 20 74 68 65 6e 0e 68 |ot Inite|d then.h|
|000014d0| 74 74 70 53 6f 63 6b 65 | 74 49 6e 69 74 06 65 6e |ttpSocke|tInit.en|
|000014e0| 64 20 69 66 00 16 69 66 | 20 70 72 6f 78 79 73 65 |d if..if| proxyse|
|000014f0| 72 76 65 72 3d 22 22 20 | 74 68 65 6e 00 1a 69 66 |rver="" |then..if|
|00001500| 20 49 6e 73 74 72 28 73 | 65 72 76 2c 20 22 3a 22 | Instr(s|erv, ":"|
|00001510| 29 3e 30 20 74 68 65 6e | 23 6d 65 2e 50 6f 72 74 |)>0 then|#me.Port|
|00001520| 3d 76 61 6c 28 6e 74 68 | 46 69 65 6c 64 28 73 65 |=val(nth|Field(se|
|00001530| 72 76 2c 20 22 3a 22 2c | 20 32 29 29 21 6d 65 2e |rv, ":",| 2))!me.|
|00001540| 41 64 64 72 65 73 73 3d | 6e 74 68 46 69 65 6c 64 |Address=|nthField|
|00001550| 28 73 65 72 76 2c 20 22 | 3a 22 2c 20 31 29 20 68 |(serv, "|:", 1) h|
|00001560| 6f 73 74 3d 6d 65 2e 41 | 64 64 72 65 73 73 2b 22 |ost=me.A|ddress+"|
|00001570| 3a 22 2b 73 74 72 28 6d | 65 2e 70 6f 72 74 29 04 |:"+str(m|e.port).|
|00001580| 65 6c 73 65 0a 6d 65 2e | 50 6f 72 74 3d 38 30 0f |else.me.|Port=80.|
|00001590| 6d 65 2e 41 64 64 72 65 | 73 73 3d 73 65 72 76 09 |me.Addre|ss=serv.|
|000015a0| 48 6f 73 74 3d 73 65 72 | 76 06 65 6e 64 20 69 66 |Host=ser|v.end if|
|000015b0| 00 2b 27 69 66 20 73 65 | 72 76 3c 3e 63 75 72 53 |.+'if se|rv<>curS|
|000015c0| 65 72 76 65 72 20 6f 72 | 20 28 6e 6f 74 20 4b 65 |erver or| (not Ke|
|000015d0| 65 70 41 6c 69 76 65 29 | 20 74 68 65 6e 0a 6d 65 |epAlive)| then.me|
|000015e0| 2e 43 6f 6e 6e 65 63 74 | 07 27 65 6e 64 20 69 66 |.Connect|.'end if|
|000015f0| 00 12 69 66 20 4d 65 74 | 68 6f 64 3d 47 65 74 20 |..if Met|hod=Get |
|00001600| 74 68 65 6e 14 69 66 20 | 50 6f 73 74 44 61 74 61 |then.if |PostData|
|00001610| 3c 3e 22 22 20 74 68 65 | 6e 32 6d 65 2e 77 72 69 |<>"" the|n2me.wri|
|00001620| 74 65 20 22 47 45 54 20 | 22 2b 70 61 74 68 2b 22 |te "GET |"+path+"|
|00001630| 3f 22 2b 50 6f 73 74 44 | 61 74 61 2b 22 20 48 54 |?"+PostD|ata+" HT|
|00001640| 54 50 2f 31 2e 31 22 2b | 63 72 6c 66 0b 50 6f 73 |TP/1.1"+|crlf.Pos|
|00001650| 74 44 61 74 61 3d 22 22 | 04 65 6c 73 65 25 6d 65 |tData=""|.else%me|
|00001660| 2e 77 72 69 74 65 20 22 | 47 45 54 20 22 2b 70 61 |.write "|GET "+pa|
|00001670| 74 68 2b 22 20 48 54 54 | 50 2f 31 2e 31 22 2b 63 |th+" HTT|P/1.1"+c|
|00001680| 72 6c 66 06 65 6e 64 20 | 69 66 17 65 6c 73 65 69 |rlf.end |if.elsei|
|00001690| 66 20 4d 65 74 68 6f 64 | 3d 50 6f 73 74 20 74 68 |f Method|=Post th|
|000016a0| 65 6e 27 6d 65 2e 77 72 | 69 74 65 20 22 50 4f 53 |en'me.wr|ite "POS|
|000016b0| 54 20 22 2b 70 61 74 68 | 2b 22 3f 20 48 54 54 50 |T "+path|+"? HTTP|
|000016c0| 2f 31 2e 31 22 2b 63 72 | 6c 66 06 65 6e 64 20 69 |/1.1"+cr|lf.end i|
|000016d0| 66 00 12 27 69 66 20 4b | 65 65 70 41 6c 69 76 65 |f..'if K|eepAlive|
|000016e0| 20 74 68 65 6e 27 27 6d | 65 2e 57 72 69 74 65 20 | then''m|e.Write |
|000016f0| 22 43 6f 6e 6e 65 63 74 | 69 6f 6e 3a 20 4b 65 65 |"Connect|ion: Kee|
|00001700| 70 2d 41 6c 69 76 65 22 | 2b 63 72 6c 66 07 27 65 |p-Alive"|+crlf.'e|
|00001710| 6e 64 20 69 66 00 32 6d | 65 2e 77 72 69 74 65 20 |nd if.2m|e.write |
|00001720| 22 55 73 65 72 2d 41 67 | 65 6e 74 3a 20 22 2b 43 |"User-Ag|ent: "+C|
|00001730| 6c 69 65 6e 74 2b 22 20 | 28 4d 61 63 69 6e 74 6f |lient+" |(Macinto|
|00001740| 73 68 29 22 2b 63 72 6c | 66 1b 6d 65 2e 77 72 69 |sh)"+crl|f.me.wri|
|00001750| 74 65 20 22 48 6f 73 74 | 3a 20 22 2b 48 6f 73 74 |te "Host|: "+Host|
|00001760| 2b 63 72 6c 66 13 69 66 | 20 4c 6f 67 69 6e 36 34 |+crlf.if| Login64|
|00001770| 3c 3e 22 22 20 74 68 65 | 6e 2d 6d 65 2e 57 72 69 |<>"" the|n-me.Wri|
|00001780| 74 65 20 22 41 75 74 68 | 6f 72 69 7a 61 74 69 6f |te "Auth|orizatio|
|00001790| 6e 3a 20 42 61 73 69 63 | 20 22 2b 4c 6f 67 69 6e |n: Basic| "+Login|
|000017a0| 36 34 2b 63 72 6c 66 06 | 65 6e 64 20 69 66 27 69 |64+crlf.|end if'i|
|000017b0| 66 20 4d 65 74 68 6f 64 | 3d 50 6f 73 74 20 61 6e |f Method|=Post an|
|000017c0| 64 20 6c 65 6e 28 50 6f | 73 74 44 61 74 61 29 3e |d len(Po|stData)>|
|000017d0| 30 20 74 68 65 6e 08 50 | 6f 73 74 46 6f 72 6d 06 |0 then.P|ostForm.|
|000017e0| 65 6e 64 20 69 66 0d 6d | 65 2e 77 72 69 74 65 20 |end if.m|e.write |
|000017f0| 63 72 6c 66 0a 4c 6f 67 | 69 6e 36 34 3d 22 22 04 |crlf.Log|in64="".|
|00001800| 65 6c 73 65 00 14 69 66 | 20 50 72 6f 78 79 50 6f |else..if| ProxyPo|
|00001810| 72 74 3c 3e 30 20 74 68 | 65 6e 11 6d 65 2e 50 6f |rt<>0 th|en.me.Po|
|00001820| 72 74 3d 50 72 6f 78 79 | 50 6f 72 74 16 6d 65 2e |rt=Proxy|Port.me.|
|00001830| 41 64 64 72 65 73 73 3d | 50 72 6f 78 79 53 65 72 |Address=|ProxySer|
|00001840| 76 65 72 04 65 6c 73 65 | 0a 6d 65 2e 50 6f 72 74 |ver.else|.me.Port|
|00001850| 3d 38 30 16 6d 65 2e 41 | 64 64 72 65 73 73 3d 50 |=80.me.A|ddress=P|
|00001860| 72 6f 78 79 53 65 72 76 | 65 72 06 65 6e 64 20 69 |roxyServ|er.end i|
|00001870| 66 00 2b 27 69 66 20 53 | 65 72 76 3c 3e 63 75 72 |f.+'if S|erv<>cur|
|00001880| 53 65 72 76 65 72 20 6f | 72 20 28 6e 6f 74 20 4b |Server o|r (not K|
|00001890| 65 65 70 41 6c 69 76 65 | 29 20 74 68 65 6e 0a 6d |eepAlive|) then.m|
|000018a0| 65 2e 43 6f 6e 6e 65 63 | 74 05 27 62 65 65 70 07 |e.Connec|t.'beep.|
|000018b0| 27 65 6e 64 20 69 66 00 | 12 69 66 20 4d 65 74 68 |'end if.|.if Meth|
|000018c0| 6f 64 3d 47 65 74 20 74 | 68 65 6e 14 69 66 20 50 |od=Get t|hen.if P|
|000018d0| 6f 73 74 44 61 74 61 3c | 3e 22 22 20 74 68 65 6e |ostData<|>"" then|
|000018e0| 3e 6d 65 2e 77 72 69 74 | 65 20 22 47 45 54 20 68 |>me.writ|e "GET h|
|000018f0| 74 74 70 3a 2f 2f 22 2b | 73 65 72 76 2b 70 61 74 |ttp://"+|serv+pat|
|00001900| 68 2b 22 3f 22 2b 50 6f | 73 74 44 61 74 61 2b 22 |h+"?"+Po|stData+"|
|00001910| 20 48 54 54 50 2f 31 2e | 31 22 2b 63 72 6c 66 0b | HTTP/1.|1"+crlf.|
|00001920| 50 6f 73 74 44 61 74 61 | 3d 22 22 04 65 6c 73 65 |PostData|="".else|
|00001930| 31 6d 65 2e 77 72 69 74 | 65 20 22 47 45 54 20 68 |1me.writ|e "GET h|
|00001940| 74 74 70 3a 2f 2f 22 2b | 73 65 72 76 2b 70 61 74 |ttp://"+|serv+pat|
|00001950| 68 2b 22 20 48 54 54 50 | 2f 31 2e 31 22 2b 63 72 |h+" HTTP|/1.1"+cr|
|00001960| 6c 66 06 65 6e 64 20 69 | 66 31 6d 65 2e 77 72 69 |lf.end i|f1me.wri|
|00001970| 74 65 20 22 47 45 54 20 | 68 74 74 70 3a 2f 2f 22 |te "GET |http://"|
|00001980| 2b 73 65 72 76 2b 70 61 | 74 68 2b 22 20 48 54 54 |+serv+pa|th+" HTT|
|00001990| 50 2f 31 2e 31 22 2b 63 | 72 6c 66 04 65 6c 73 65 |P/1.1"+c|rlf.else|
|000019a0| 33 6d 65 2e 57 72 69 74 | 65 20 22 50 4f 53 54 20 |3me.Writ|e "POST |
|000019b0| 68 74 74 70 3a 2f 2f 22 | 2b 73 65 72 76 2b 70 61 |http://"|+serv+pa|
|000019c0| 74 68 2b 22 3f 20 48 54 | 54 50 2f 31 2e 31 22 2b |th+"? HT|TP/1.1"+|
|000019d0| 63 72 6c 66 06 65 6e 64 | 20 69 66 00 12 27 69 66 |crlf.end| if..'if|
|000019e0| 20 4b 65 65 70 41 6c 69 | 76 65 20 74 68 65 6e 27 | KeepAli|ve then'|
|000019f0| 27 6d 65 2e 57 72 69 74 | 65 20 22 43 6f 6e 6e 65 |'me.Writ|e "Conne|
|00001a00| 63 74 69 6f 6e 3a 20 4b | 65 65 70 2d 41 6c 69 76 |ction: K|eep-Aliv|
|00001a10| 65 22 2b 63 72 6c 66 07 | 27 65 6e 64 20 69 66 00 |e"+crlf.|'end if.|
|00001a20| 32 6d 65 2e 77 72 69 74 | 65 20 22 55 73 65 72 2d |2me.writ|e "User-|
|00001a30| 41 67 65 6e 74 3a 20 22 | 2b 43 6c 69 65 6e 74 2b |Agent: "|+Client+|
|00001a40| 22 20 28 4d 61 63 69 6e | 74 6f 73 68 29 22 2b 63 |" (Macin|tosh)"+c|
|00001a50| 72 6c 66 00 00 13 69 66 | 20 6c 6f 67 69 6e 36 34 |rlf...if| login64|
|00001a60| 3c 3e 22 22 20 74 68 65 | 6e 2d 6d 65 2e 57 72 69 |<>"" the|n-me.Wri|
|00001a70| 74 65 20 22 41 75 74 68 | 6f 72 69 7a 61 74 69 6f |te "Auth|orizatio|
|00001a80| 6e 3a 20 42 61 73 69 63 | 20 22 2b 4c 6f 67 69 6e |n: Basic| "+Login|
|00001a90| 36 34 2b 63 72 6c 66 06 | 65 6e 64 20 69 66 00 27 |64+crlf.|end if.'|
|00001aa0| 69 66 20 4d 65 74 68 6f | 64 3d 50 6f 73 74 20 61 |if Metho|d=Post a|
|00001ab0| 6e 64 20 6c 65 6e 28 50 | 6f 73 74 44 61 74 61 29 |nd len(P|ostData)|
|00001ac0| 3e 30 20 74 68 65 6e 08 | 50 6f 73 74 46 6f 72 6d |>0 then.|PostForm|
|00001ad0| 06 65 6e 64 20 69 66 0d | 6d 65 2e 77 72 69 74 65 |.end if.|me.write|
|00001ae0| 20 63 72 6c 66 0a 4c 6f | 67 69 6e 36 34 3d 22 22 | crlf.Lo|gin64=""|
|00001af0| 06 65 6e 64 20 69 66 00 | 0a 6c 6f 67 69 6e 36 34 |.end if.|.login64|
|00001b00| 3d 22 22 0e 63 75 72 53 | 65 72 76 65 72 3d 53 65 |="".curS|erver=Se|
|00001b10| 72 76 07 45 6e 64 20 53 | 75 62 09 47 65 74 52 65 |rv.End S|ub.GetRe|
|00001b20| 6c 55 52 4c 23 62 61 73 | 65 55 52 4c 20 61 73 20 |lURL#bas|eURL as |
|00001b30| 73 74 72 69 6e 67 2c 20 | 72 65 6c 55 52 4c 20 61 |string, |relURL a|
|00001b40| 73 20 73 74 72 69 6e 67 | 06 73 74 72 69 6e 67 00 |s string|.string.|
|00001b50| 04 0e 04 0e 24 81 01 46 | 75 6e 63 74 69 6f 6e 20 |....$..F|unction |
|00001b60| 47 65 74 52 65 6c 55 52 | 4c 28 62 61 73 65 55 52 |GetRelUR|L(baseUR|
|00001b70| 4c 20 61 73 20 73 74 72 | 69 6e 67 2c 20 72 65 6c |L as str|ing, rel|
|00001b80| 55 52 4c 20 61 73 20 73 | 74 72 69 6e 67 29 20 41 |URL as s|tring) A|
|00001b90| 73 20 73 74 72 69 6e 67 | 20 64 69 6d 20 49 20 61 |s string| dim I a|
|00001ba0| 73 20 69 6e 74 65 67 65 | 72 2c 20 62 2c 20 6c 20 |s intege|r, b, l |
|00001bb0| 61 73 20 73 74 72 69 6e | 67 00 12 69 66 20 6e 6f |as strin|g..if no|
|00001bc0| 74 20 49 6e 69 74 65 64 | 20 74 68 65 6e 0e 68 74 |t Inited| then.ht|
|00001bd0| 74 70 53 6f 63 6b 65 74 | 49 6e 69 74 06 65 6e 64 |tpSocket|Init.end|
|00001be0| 20 69 66 00 1d 69 66 20 | 69 6e 73 74 72 28 72 65 | if..if |instr(re|
|00001bf0| 6c 55 52 4c 2c 20 22 2e | 2e 22 29 3d 30 20 74 68 |lURL, ".|.")=0 th|
|00001c00| 65 6e 1d 49 66 20 52 69 | 67 68 74 28 62 61 73 65 |en.If Ri|ght(base|
|00001c10| 55 52 4c 2c 20 31 29 3d | 22 2f 22 20 74 68 65 6e |URL, 1)=|"/" then|
|00001c20| 15 72 65 74 75 72 6e 20 | 62 61 73 65 55 52 4c 2b |.return |baseURL+|
|00001c30| 72 65 6c 55 52 4c 04 65 | 6c 73 65 20 72 65 74 75 |relURL.e|lse retu|
|00001c40| 72 6e 20 54 72 69 6d 54 | 6f 44 69 72 28 62 61 73 |rn TrimT|oDir(bas|
|00001c50| 65 55 52 4c 29 2b 72 65 | 6c 55 52 4c 06 65 6e 64 |eURL)+re|lURL.end|
|00001c60| 20 69 66 00 04 65 6c 73 | 65 09 62 3d 62 61 73 65 | if..els|e.b=base|
|00001c70| 55 52 4c 00 17 69 66 20 | 72 69 67 68 74 28 62 2c |URL..if |right(b,|
|00001c80| 20 31 29 3d 22 2f 22 20 | 74 68 65 6e 0e 62 3d 54 | 1)="/" |then.b=T|
|00001c90| 72 69 6d 54 6f 44 69 72 | 28 62 29 06 65 6e 64 20 |rimToDir|(b).end |
|00001ca0| 69 66 00 25 66 6f 72 20 | 49 20 3d 20 31 20 74 6f |if.%for |I = 1 to|
|00001cb0| 20 63 6f 75 6e 74 66 69 | 65 6c 64 73 28 72 65 6c | countfi|elds(rel|
|00001cc0| 55 52 4c 2c 20 22 2f 22 | 29 1a 6c 3d 6e 74 68 46 |URL, "/"|).l=nthF|
|00001cd0| 69 65 6c 64 28 72 65 6c | 55 52 4c 2c 20 22 2f 22 |ield(rel|URL, "/"|
|00001ce0| 2c 20 49 29 0e 69 66 20 | 6c 3d 22 2e 2e 22 20 74 |, I).if |l=".." t|
|00001cf0| 68 65 6e 0e 62 3d 54 72 | 69 6d 54 6f 44 69 72 28 |hen.b=Tr|imToDir(|
|00001d00| 62 29 27 65 6c 73 65 69 | 66 20 49 3c 3e 63 6f 75 |b)'elsei|f I<>cou|
|00001d10| 6e 74 46 69 65 6c 64 73 | 28 72 65 6c 55 52 4c 2c |ntFields|(relURL,|
|00001d20| 20 22 2f 22 29 20 74 68 | 65 6e 09 62 3d 62 2b 6c | "/") th|en.b=b+l|
|00001d30| 2b 22 2f 22 04 65 6c 73 | 65 05 62 3d 62 2b 6c 06 |+"/".els|e.b=b+l.|
|00001d40| 65 6e 64 20 69 66 04 6e | 65 78 74 08 72 65 74 75 |end if.n|ext.retu|
|00001d50| 72 6e 20 62 00 06 65 6e | 64 20 69 66 00 0c 45 6e |rn b..en|d if..En|
|00001d60| 64 20 46 75 6e 63 74 69 | 6f 6e 09 54 72 69 6d 54 |d Functi|on.TrimT|
|00001d70| 6f 44 69 72 0b 74 20 61 | 73 20 73 74 72 69 6e 67 |oDir.t a|s string|
|00001d80| 06 73 74 72 69 6e 67 00 | 04 0e 04 0e 0e 29 46 75 |.string.|.....)Fu|
|00001d90| 6e 63 74 69 6f 6e 20 54 | 72 69 6d 54 6f 44 69 72 |nction T|rimToDir|
|00001da0| 28 74 20 61 73 20 73 74 | 72 69 6e 67 29 20 41 73 |(t as st|ring) As|
|00001db0| 20 73 74 72 69 6e 67 0f | 64 69 6d 20 62 20 61 73 | string.|dim b as|
|00001dc0| 20 73 74 72 69 6e 67 00 | 12 69 66 20 6e 6f 74 20 | string.|.if not |
|00001dd0| 49 6e 69 74 65 64 20 74 | 68 65 6e 0e 68 74 74 70 |Inited t|hen.http|
|00001de0| 53 6f 63 6b 65 74 49 6e | 69 74 06 65 6e 64 20 69 |SocketIn|it.end i|
|00001df0| 66 00 13 62 3d 6c 65 66 | 74 28 74 2c 20 6c 65 6e |f..b=lef|t(t, len|
|00001e00| 28 74 29 2d 31 29 20 77 | 68 69 6c 65 20 72 69 67 |(t)-1) w|hile rig|
|00001e10| 68 74 28 62 2c 20 31 29 | 3c 3e 22 2f 22 20 61 6e |ht(b, 1)|<>"/" an|
|00001e20| 64 20 62 3c 3e 22 22 13 | 62 3d 6c 65 66 74 28 62 |d b<>"".|b=left(b|
|00001e30| 2c 20 6c 65 6e 28 62 29 | 2d 31 29 04 77 65 6e 64 |, len(b)|-1).wend|
|00001e40| 00 08 72 65 74 75 72 6e | 20 62 0c 45 6e 64 20 46 |..return| b.End F|
|00001e50| 75 6e 63 74 69 6f 6e 0d | 53 65 74 43 6c 69 65 6e |unction.|SetClien|
|00001e60| 74 4e 61 6d 65 21 6e 61 | 6d 65 20 61 73 20 73 74 |tName!na|me as st|
|00001e70| 72 69 6e 67 2c 20 76 65 | 72 73 69 6f 6e 20 61 73 |ring, ve|rsion as|
|00001e80| 20 73 69 6e 67 6c 65 00 | 00 02 0e 02 0e 0a 34 53 | single.|......4S|
|00001e90| 75 62 20 53 65 74 43 6c | 69 65 6e 74 4e 61 6d 65 |ub SetCl|ientName|
|00001ea0| 28 6e 61 6d 65 20 61 73 | 20 73 74 72 69 6e 67 2c |(name as| string,|
|00001eb0| 20 76 65 72 73 69 6f 6e | 20 61 73 20 73 69 6e 67 | version| as sing|
|00001ec0| 6c 65 29 12 69 66 20 6e | 6f 74 20 49 6e 69 74 65 |le).if n|ot Inite|
|00001ed0| 64 20 74 68 65 6e 0e 68 | 74 74 70 53 6f 63 6b 65 |d then.h|ttpSocke|
|00001ee0| 74 49 6e 69 74 06 65 6e | 64 20 69 66 00 20 43 6c |tInit.en|d if. Cl|
|00001ef0| 69 65 6e 74 3d 52 65 70 | 6c 61 63 65 41 6c 6c 28 |ient=Rep|laceAll(|
|00001f00| 6e 61 6d 65 2c 20 22 20 | 22 2c 20 22 22 29 20 43 |name, " |", "") C|
|00001f10| 6c 69 65 6e 74 3d 52 65 | 70 6c 61 63 65 61 6c 6c |lient=Re|placeall|
|00001f20| 28 6e 61 6d 65 2c 20 22 | 2f 22 2c 20 22 22 29 11 |(name, "|/", "").|
|00001f30| 43 6c 69 65 6e 74 3d 43 | 6c 69 65 6e 74 2b 22 2f |Client=C|lient+"/|
|00001f40| 22 2f 43 6c 69 65 6e 74 | 3d 43 6c 69 65 6e 74 2b |"/Client|=Client+|
|00001f50| 72 65 70 6c 61 63 65 61 | 6c 6c 28 73 74 72 28 76 |replacea|ll(str(v|
|00001f60| 65 72 73 69 6f 6e 29 2c | 20 22 2e 22 2c 20 22 22 |ersion),| ".", ""|
|00001f70| 29 07 45 6e 64 20 53 75 | 62 09 44 6f 47 65 74 50 |).End Su|b.DoGetP|
|00001f80| 61 73 73 0c 6e 20 61 73 | 20 69 6e 74 65 67 65 72 |ass.n as| integer|
|00001f90| 07 69 6e 74 65 67 65 72 | 00 04 0e 04 0e 1b 2b 46 |.integer|......+F|
|00001fa0| 75 6e 63 74 69 6f 6e 20 | 44 6f 47 65 74 50 61 73 |unction |DoGetPas|
|00001fb0| 73 28 6e 20 61 73 20 69 | 6e 74 65 67 65 72 29 20 |s(n as i|nteger) |
|00001fc0| 41 73 20 69 6e 74 65 67 | 65 72 12 64 69 6d 20 73 |As integ|er.dim s|
|00001fd0| 2c 20 72 20 61 73 20 73 | 74 72 69 6e 67 00 12 69 |, r as s|tring..i|
|00001fe0| 66 20 6e 6f 74 20 49 6e | 69 74 65 64 20 74 68 65 |f not In|ited the|
|00001ff0| 6e 0e 68 74 74 70 53 6f | 63 6b 65 74 49 6e 69 74 |n.httpSo|cketInit|
|00002000| 06 65 6e 64 20 69 66 00 | 14 72 3d 74 72 69 6d 28 |.end if.|.r=trim(|
|00002010| 48 65 61 64 65 72 56 61 | 6c 28 6e 29 29 00 26 69 |HeaderVa|l(n)).&i|
|00002020| 66 20 6c 6f 77 65 72 63 | 61 73 65 28 6c 65 66 74 |f lowerc|ase(left|
|00002030| 28 72 2c 20 35 29 29 3c | 3e 22 42 61 73 69 63 22 |(r, 5))<|>"Basic"|
|00002040| 20 74 68 65 6e 20 2f 2f | 20 55 6e 6b 6e 6f 77 6e | then //| Unknown|
|00002050| 20 61 75 74 68 65 6e 74 | 69 63 61 74 69 6f 6e 20 | authent|ication |
|00002060| 73 63 68 65 6d 65 09 72 | 65 74 75 72 6e 20 2d 31 |scheme.r|eturn -1|
|00002070| 06 65 6e 64 20 69 66 00 | 1e 72 3d 6d 69 64 28 72 |.end if.|.r=mid(r|
|00002080| 2c 20 69 6e 73 74 72 28 | 72 2c 20 22 72 65 61 6c |, instr(|r, "real|
|00002090| 6d 3d 22 29 2b 37 29 1c | 72 3d 72 65 70 6c 61 63 |m=")+7).|r=replac|
|000020a0| 65 61 6c 6c 28 72 2c 20 | 63 68 72 28 33 34 29 2c |eall(r, |chr(34),|
|000020b0| 20 22 22 29 00 13 73 3d | 50 61 73 73 77 6f 72 64 | "")..s=|Password|
|000020c0| 4e 65 65 64 65 64 28 72 | 29 00 28 69 66 20 73 3d |Needed(r|).(if s=|
|000020d0| 22 22 20 6f 72 20 73 3d | 22 3a 22 20 6f 72 20 69 |"" or s=|":" or i|
|000020e0| 6e 73 74 72 28 73 2c 20 | 22 3a 22 29 3d 30 20 74 |nstr(s, |":")=0 t|
|000020f0| 68 65 6e 09 43 61 6e 63 | 65 6c 6c 65 64 09 72 65 |hen.Canc|elled.re|
|00002100| 74 75 72 6e 20 2d 31 06 | 65 6e 64 20 69 66 00 14 |turn -1.|end if..|
|00002110| 4c 6f 67 69 6e 36 34 3d | 47 65 74 62 61 73 65 36 |Login64=|Getbase6|
|00002120| 34 28 73 29 00 0c 45 6e | 64 20 46 75 6e 63 74 69 |4(s)..En|d Functi|
|00002130| 6f 6e 09 47 65 74 42 61 | 73 65 36 34 0d 74 78 74 |on.GetBa|se64.txt|
|00002140| 20 61 73 20 73 74 72 69 | 6e 67 06 73 74 72 69 6e | as stri|ng.strin|
|00002150| 67 00 04 0e 04 0e 1d 2b | 46 75 6e 63 74 69 6f 6e |g......+|Function|
|00002160| 20 47 65 74 42 61 73 65 | 36 34 28 74 78 74 20 61 | GetBase|64(txt a|
|00002170| 73 20 73 74 72 69 6e 67 | 29 20 41 73 20 73 74 72 |s string|) As str|
|00002180| 69 6e 67 2c 64 69 6d 20 | 73 2c 20 72 2c 20 6f 28 |ing,dim |s, r, o(|
|00002190| 30 29 2c 20 70 20 61 73 | 20 73 74 72 69 6e 67 2c |0), p as| string,|
|000021a0| 20 49 2c 20 78 20 61 73 | 20 69 6e 74 65 67 65 72 | I, x as| integer|
|000021b0| 00 12 69 66 20 6e 6f 74 | 20 49 6e 69 74 65 64 20 |..if not| Inited |
|000021c0| 74 68 65 6e 0e 68 74 74 | 70 53 6f 63 6b 65 74 49 |then.htt|pSocketI|
|000021d0| 6e 69 74 06 65 6e 64 20 | 69 66 00 05 73 3d 74 78 |nit.end |if..s=tx|
|000021e0| 74 00 13 66 6f 72 20 49 | 20 3d 20 31 20 74 6f 20 |t..for I| = 1 to |
|000021f0| 6c 65 6e 28 73 29 1e 72 | 3d 72 2b 20 47 65 74 62 |len(s).r|=r+ Getb|
|00002200| 69 6e 28 61 73 63 28 6d | 69 64 28 73 2c 20 49 2c |in(asc(m|id(s, I,|
|00002210| 20 31 29 29 29 04 6e 65 | 78 74 00 1a 66 6f 72 20 | 1))).ne|xt..for |
|00002220| 69 20 3d 20 31 20 74 6f | 20 6c 65 6e 28 72 29 20 |i = 1 to| len(r) |
|00002230| 73 74 65 70 20 36 12 69 | 66 20 6c 65 6e 28 72 29 |step 6.i|f len(r)|
|00002240| 2d 49 3c 36 20 74 68 65 | 6e 17 6f 2e 41 70 70 65 |-I<6 the|n.o.Appe|
|00002250| 6e 64 20 22 30 30 22 2b | 6d 69 64 28 72 2c 20 49 |nd "00"+|mid(r, I|
|00002260| 29 15 78 3d 38 2d 6c 65 | 6e 28 6f 28 75 62 6f 75 |).x=8-le|n(o(ubou|
|00002270| 6e 64 28 6f 29 29 29 2b | 6f 28 75 62 6f 75 6e 64 |nd(o)))+|o(ubound|
|00002280| 28 6f 29 29 3d 6f 28 75 | 62 6f 75 6e 64 28 6f 29 |(o))=o(u|bound(o)|
|00002290| 29 2b 47 65 74 53 74 72 | 50 61 74 28 78 2c 20 22 |)+GetStr|Pat(x, "|
|000022a0| 30 22 29 04 65 6c 73 65 | 1a 6f 2e 41 70 70 65 6e |0").else|.o.Appen|
|000022b0| 64 20 22 30 30 22 2b 6d | 69 64 28 72 2c 20 49 2c |d "00"+m|id(r, I,|
|000022c0| 20 36 29 06 65 6e 64 20 | 69 66 04 6e 65 78 74 00 | 6).end |if.next.|
|000022d0| 16 66 6f 72 20 49 20 3d | 20 31 20 74 6f 20 75 62 |.for I =| 1 to ub|
|000022e0| 6f 75 6e 64 28 6f 29 1b | 70 3d 70 2b 67 65 74 63 |ound(o).|p=p+getc|
|000022f0| 68 61 72 28 76 61 6c 28 | 22 26 62 22 2b 6f 28 49 |har(val(|"&b"+o(I|
|00002300| 29 29 29 04 6e 65 78 74 | 00 08 72 65 74 75 72 6e |))).next|..return|
|00002310| 20 70 0c 45 6e 64 20 46 | 75 6e 63 74 69 6f 6e 09 | p.End F|unction.|
|00002320| 47 65 74 53 74 72 50 61 | 74 1b 6e 75 6d 20 61 73 |GetStrPa|t.num as|
|00002330| 20 69 6e 74 65 67 65 72 | 2c 20 73 20 61 73 20 73 | integer|, s as s|
|00002340| 74 72 69 6e 67 06 73 74 | 72 69 6e 67 00 04 0e 04 |tring.st|ring....|
|00002350| 0e 0c 39 46 75 6e 63 74 | 69 6f 6e 20 47 65 74 53 |..9Funct|ion GetS|
|00002360| 74 72 50 61 74 28 6e 75 | 6d 20 61 73 20 69 6e 74 |trPat(nu|m as int|
|00002370| 65 67 65 72 2c 20 73 20 | 61 73 20 73 74 72 69 6e |eger, s |as strin|
|00002380| 67 29 20 41 73 20 73 74 | 72 69 6e 67 1f 64 69 6d |g) As st|ring.dim|
|00002390| 20 49 20 61 73 20 69 6e | 74 65 67 65 72 2c 20 72 | I as in|teger, r|
|000023a0| 65 74 20 61 73 20 73 74 | 72 69 6e 67 00 12 69 66 |et as st|ring..if|
|000023b0| 20 6e 6f 74 20 49 6e 69 | 74 65 64 20 74 68 65 6e | not Ini|ted then|
|000023c0| 0e 68 74 74 70 53 6f 63 | 6b 65 74 49 6e 69 74 06 |.httpSoc|ketInit.|
|000023d0| 65 6e 64 20 69 66 00 10 | 66 6f 72 20 49 20 3d 20 |end if..|for I = |
|000023e0| 31 20 74 6f 20 6e 75 6d | 09 72 65 74 3d 72 65 74 |1 to num|.ret=ret|
|000023f0| 2b 73 04 6e 65 78 74 0a | 72 65 74 75 72 6e 20 72 |+s.next.|return r|
|00002400| 65 74 0c 45 6e 64 20 46 | 75 6e 63 74 69 6f 6e 07 |et.End F|unction.|
|00002410| 47 65 74 43 68 61 72 0c | 6e 20 61 73 20 69 6e 74 |GetChar.|n as int|
|00002420| 65 67 65 72 06 73 74 72 | 69 6e 67 00 02 0e 02 0e |eger.str|ing.....|
|00002430| 11 28 46 75 6e 63 74 69 | 6f 6e 20 47 65 74 43 68 |.(Functi|on GetCh|
|00002440| 61 72 28 6e 20 61 73 20 | 69 6e 74 65 67 65 72 29 |ar(n as |integer)|
|00002450| 20 41 73 20 73 74 72 69 | 6e 67 12 69 66 20 6e 6f | As stri|ng.if no|
|00002460| 74 20 49 6e 69 74 65 64 | 20 74 68 65 6e 0e 68 74 |t Inited| then.ht|
|00002470| 74 70 53 6f 63 6b 65 74 | 49 6e 69 74 06 65 6e 64 |tpSocket|Init.end|
|00002480| 20 69 66 00 0d 69 66 20 | 6e 3c 3d 32 35 20 74 68 | if..if |n<=25 th|
|00002490| 65 6e 17 72 65 74 75 72 | 6e 20 63 68 72 28 6e 2b |en.retur|n chr(n+|
|000024a0| 36 35 29 20 2f 2f 20 41 | 2d 5a 11 65 6c 73 65 69 |65) // A|-Z.elsei|
|000024b0| 66 20 6e 3c 3d 35 31 20 | 74 68 65 6e 17 72 65 74 |f n<=51 |then.ret|
|000024c0| 75 72 6e 20 63 68 72 28 | 6e 2b 37 31 29 20 2f 2f |urn chr(|n+71) //|
|000024d0| 20 61 2d 7a 11 65 6c 73 | 65 69 66 20 6e 3c 3d 36 | a-z.els|eif n<=6|
|000024e0| 31 20 74 68 65 6e 17 72 | 65 74 75 72 6e 20 63 68 |1 then.r|eturn ch|
|000024f0| 72 28 6e 2d 34 29 20 20 | 2f 2f 20 30 2d 39 10 65 |r(n-4) |// 0-9.e|
|00002500| 6c 73 65 69 66 20 6e 3d | 36 32 20 74 68 65 6e 15 |lseif n=|62 then.|
|00002510| 72 65 74 75 72 6e 20 63 | 68 72 28 34 33 29 20 20 |return c|hr(43) |
|00002520| 20 2f 2f 20 2b 10 65 6c | 73 65 69 66 20 6e 3d 36 | // +.el|seif n=6|
|00002530| 33 20 74 68 65 6e 15 72 | 65 74 75 72 6e 20 63 68 |3 then.r|eturn ch|
|00002540| 72 28 34 37 29 20 20 20 | 2f 2f 20 2f 06 65 6e 64 |r(47) |// /.end|
|00002550| 20 69 66 0c 45 6e 64 20 | 46 75 6e 63 74 69 6f 6e | if.End |Function|
|00002560| 06 47 65 74 42 69 6e 0c | 6d 20 61 73 20 69 6e 74 |.GetBin.|m as int|
|00002570| 65 67 65 72 06 73 74 72 | 69 6e 67 00 04 0e 04 0e |eger.str|ing.....|
|00002580| 13 27 46 75 6e 63 74 69 | 6f 6e 20 47 65 74 42 69 |.'Functi|on GetBi|
|00002590| 6e 28 6d 20 61 73 20 69 | 6e 74 65 67 65 72 29 20 |n(m as i|nteger) |
|000025a0| 41 73 20 73 74 72 69 6e | 67 20 64 69 6d 20 6e 2c |As strin|g dim n,|
|000025b0| 20 49 20 61 73 20 69 6e | 74 65 67 65 72 2c 20 73 | I as in|teger, s|
|000025c0| 20 61 73 20 73 74 72 69 | 6e 67 00 12 69 66 20 6e | as stri|ng..if n|
|000025d0| 6f 74 20 49 6e 69 74 65 | 64 20 74 68 65 6e 0e 68 |ot Inite|d then.h|
|000025e0| 74 74 70 53 6f 63 6b 65 | 74 49 6e 69 74 06 65 6e |ttpSocke|tInit.en|
|000025f0| 64 20 69 66 00 03 6e 3d | 6d 00 12 66 6f 72 20 49 |d if..n=|m..for I|
|00002600| 20 3d 20 37 20 64 6f 77 | 6e 74 6f 20 30 14 69 66 | = 7 dow|nto 0.if|
|00002610| 20 6e 3e 3d 50 6f 77 28 | 32 2c 20 49 29 20 74 68 | n>=Pow(|2, I) th|
|00002620| 65 6e 0c 6e 3d 6e 2d 50 | 6f 77 28 32 2c 49 29 07 |en.n=n-P|ow(2,I).|
|00002630| 73 3d 73 2b 22 31 22 04 | 65 6c 73 65 07 73 3d 73 |s=s+"1".|else.s=s|
|00002640| 2b 22 30 22 06 65 6e 64 | 20 69 66 04 6e 65 78 74 |+"0".end| if.next|
|00002650| 08 72 65 74 75 72 6e 20 | 73 0c 45 6e 64 20 46 75 |.return |s.End Fu|
|00002660| 6e 63 74 69 6f 6e 0b 53 | 65 74 46 69 6c 65 54 79 |nction.S|etFileTy|
|00002670| 70 65 23 6d 69 6d 65 6e | 61 6d 65 20 61 73 20 73 |pe#mimen|ame as s|
|00002680| 74 72 69 6e 67 2c 20 66 | 20 61 73 20 66 6f 6c 64 |tring, f| as fold|
|00002690| 65 72 69 74 65 6d 00 00 | 04 0e 04 0e 11 34 53 75 |eritem..|.....4Su|
|000026a0| 62 20 53 65 74 46 69 6c | 65 54 79 70 65 28 6d 69 |b SetFil|eType(mi|
|000026b0| 6d 65 6e 61 6d 65 20 61 | 73 20 73 74 72 69 6e 67 |mename a|s string|
|000026c0| 2c 20 66 20 61 73 20 66 | 6f 6c 64 65 72 69 74 65 |, f as f|olderite|
|000026d0| 6d 29 10 64 69 6d 20 69 | 20 61 73 20 69 6e 74 65 |m).dim i| as inte|
|000026e0| 67 65 72 00 12 69 66 20 | 6e 6f 74 20 49 6e 69 74 |ger..if |not Init|
|000026f0| 65 64 20 74 68 65 6e 0e | 68 74 74 70 53 6f 63 6b |ed then.|httpSock|
|00002700| 65 74 49 6e 69 74 06 65 | 6e 64 20 69 66 00 17 66 |etInit.e|nd if..f|
|00002710| 6f 72 20 69 3d 31 20 74 | 6f 20 75 62 6f 75 6e 64 |or i=1 t|o ubound|
|00002720| 28 6d 69 6d 65 29 32 69 | 66 20 73 74 72 63 6f 6d |(mime)2i|f strcom|
|00002730| 70 28 6c 6f 77 65 72 63 | 61 73 65 28 6d 69 6d 65 |p(lowerc|ase(mime|
|00002740| 6e 61 6d 65 29 2c 20 6d | 69 6d 65 28 69 29 2c 20 |name), m|ime(i), |
|00002750| 30 29 3d 30 20 74 68 65 | 6e 16 66 2e 6d 61 63 74 |0)=0 the|n.f.mact|
|00002760| 79 70 65 3d 20 6d 69 6d | 65 74 79 70 65 28 69 29 |ype= mim|etype(i)|
|00002770| 1c 66 2e 6d 61 63 63 72 | 65 61 74 6f 72 3d 20 6d |.f.maccr|eator= m|
|00002780| 69 6d 65 63 72 65 61 74 | 6f 72 28 69 29 06 72 65 |imecreat|or(i).re|
|00002790| 74 75 72 6e 06 65 6e 64 | 20 69 66 04 6e 65 78 74 |turn.end| if.next|
|000027a0| 11 66 2e 6d 61 63 74 79 | 70 65 3d 20 22 54 45 58 |.f.macty|pe= "TEX|
|000027b0| 54 22 14 66 2e 4d 61 63 | 43 72 65 61 74 6f 72 3d |T".f.Mac|Creator=|
|000027c0| 20 22 74 74 78 74 22 07 | 45 6e 64 20 53 75 62 07 | "ttxt".|End Sub.|
|000027d0| 41 64 64 4d 69 6d 65 32 | 6d 69 6d 72 20 61 73 20 |AddMime2|mimr as |
|000027e0| 73 74 72 69 6e 67 2c 20 | 6d 74 79 70 65 20 61 73 |string, |mtype as|
|000027f0| 20 73 74 72 69 6e 67 2c | 20 63 72 65 61 74 6f 72 | string,| creator|
|00002800| 20 61 73 20 73 74 72 69 | 6e 67 00 00 02 0e 02 0e | as stri|ng......|
|00002810| 09 3f 53 75 62 20 41 64 | 64 4d 69 6d 65 28 6d 69 |.?Sub Ad|dMime(mi|
|00002820| 6d 72 20 61 73 20 73 74 | 72 69 6e 67 2c 20 6d 74 |mr as st|ring, mt|
|00002830| 79 70 65 20 61 73 20 73 | 74 72 69 6e 67 2c 20 63 |ype as s|tring, c|
|00002840| 72 65 61 74 6f 72 20 61 | 73 20 73 74 72 69 6e 67 |reator a|s string|
|00002850| 29 12 69 66 20 6e 6f 74 | 20 49 6e 69 74 65 64 20 |).if not| Inited |
|00002860| 74 68 65 6e 0e 68 74 74 | 70 53 6f 63 6b 65 74 49 |then.htt|pSocketI|
|00002870| 6e 69 74 06 65 6e 64 20 | 69 66 00 1b 4d 69 6d 65 |nit.end |if..Mime|
|00002880| 2e 41 70 70 65 6e 64 20 | 6c 6f 77 65 72 63 61 73 |.Append |lowercas|
|00002890| 65 28 6d 69 6d 72 29 15 | 6d 69 6d 65 74 79 70 65 |e(mimr).|mimetype|
|000028a0| 2e 61 70 70 65 6e 64 20 | 6d 74 79 70 65 1a 6d 69 |.append |mtype.mi|
|000028b0| 6d 65 63 72 65 61 74 6f | 72 2e 61 70 70 65 6e 64 |mecreato|r.append|
|000028c0| 20 63 72 65 61 74 6f 72 | 07 45 6e 64 20 53 75 62 | creator|.End Sub|
|000028d0| 0e 44 6f 46 69 6c 65 46 | 69 6e 69 73 68 65 64 00 |.DoFileF|inished.|
|000028e0| 00 00 05 0e 05 0e 32 14 | 53 75 62 20 44 6f 46 69 |......2.|Sub DoFi|
|000028f0| 6c 65 46 69 6e 69 73 68 | 65 64 28 29 32 64 69 6d |leFinish|ed()2dim|
|00002900| 20 74 65 6d 70 32 2c 20 | 69 2c 20 6e 20 61 73 20 | temp2, |i, n as |
|00002910| 69 6e 74 65 67 65 72 2c | 20 73 74 20 61 73 20 54 |integer,| st as T|
|00002920| 65 78 74 4f 75 74 70 75 | 74 53 74 72 65 61 6d 20 |extOutpu|tStream |
|00002930| 64 69 6d 20 74 65 6d 70 | 20 61 73 20 73 74 72 69 |dim temp| as stri|
|00002940| 6e 67 2c 20 62 20 61 73 | 20 62 6f 6f 6c 65 61 6e |ng, b as| boolean|
|00002950| 00 12 69 66 20 6e 6f 74 | 20 49 6e 69 74 65 64 20 |..if not| Inited |
|00002960| 74 68 65 6e 0e 68 74 74 | 70 53 6f 63 6b 65 74 49 |then.htt|pSocketI|
|00002970| 6e 69 74 06 65 6e 64 20 | 69 66 00 11 2f 2f 20 49 |nit.end |if..// I|
|00002980| 74 27 73 20 66 69 6e 69 | 73 68 65 64 21 13 69 66 |t's fini|shed!.if|
|00002990| 20 6c 6f 67 69 6e 36 34 | 3c 3e 22 22 20 74 68 65 | login64|<>"" the|
|000029a0| 6e 10 69 66 20 70 61 73 | 73 6c 61 73 74 20 74 68 |n.if pas|slast th|
|000029b0| 65 6e 16 62 3d 4c 6f 67 | 69 6e 46 61 69 6c 65 64 |en.b=Log|inFailed|
|000029c0| 28 63 75 72 53 69 74 65 | 29 0d 70 61 73 73 6c 61 |(curSite|).passla|
|000029d0| 73 74 3d 74 72 75 65 04 | 65 6c 73 65 06 62 3d 74 |st=true.|else.b=t|
|000029e0| 72 75 65 0d 70 61 73 73 | 6c 61 73 74 3d 74 72 75 |rue.pass|last=tru|
|000029f0| 65 06 65 6e 64 20 69 66 | 00 09 69 66 20 62 20 74 |e.end if|..if b t|
|00002a00| 68 65 6e 1d 74 65 6d 70 | 32 3d 44 6f 47 65 74 50 |hen.temp|2=DoGetP|
|00002a10| 61 73 73 28 76 61 6c 28 | 6c 6f 67 69 6e 36 34 29 |ass(val(|login64)|
|00002a20| 29 0f 69 66 20 74 65 6d | 70 32 3d 30 20 74 68 65 |).if tem|p2=0 the|
|00002a30| 6e 16 73 74 3d 66 69 6c | 65 2e 43 72 65 61 74 65 |n.st=fil|e.Create|
|00002a40| 54 65 78 74 46 69 6c 65 | 08 73 74 2e 63 6c 6f 73 |TextFile|.st.clos|
|00002a50| 65 0f 47 65 74 48 54 54 | 50 20 63 75 72 53 69 74 |e.GetHTT|P curSit|
|00002a60| 65 06 72 65 74 75 72 6e | 06 65 6e 64 20 69 66 00 |e.return|.end if.|
|00002a70| 04 65 6c 73 65 0e 70 61 | 73 73 6c 61 73 74 3d 66 |.else.pa|sslast=f|
|00002a80| 61 6c 73 65 06 65 6e 64 | 20 69 66 00 06 65 6e 64 |alse.end| if..end|
|00002a90| 20 69 66 00 10 69 66 20 | 44 4c 54 79 70 65 3d 31 | if..if |DLType=1|
|00002aa0| 20 74 68 65 6e 08 44 4c | 54 79 70 65 3d 30 0e 70 | then.DL|Type=0.p|
|00002ab0| 61 73 73 6c 61 73 74 3d | 66 61 6c 73 65 00 21 69 |asslast=|false.!i|
|00002ac0| 66 20 6c 65 66 74 28 66 | 69 6c 65 74 79 70 65 2c |f left(f|iletype,|
|00002ad0| 20 35 29 3d 22 69 6d 61 | 67 65 22 20 74 68 65 6e | 5)="ima|ge" then|
|00002ae0| 33 44 4c 46 69 6e 69 73 | 68 65 64 20 66 69 6c 65 |3DLFinis|hed file|
|00002af0| 2c 20 74 65 78 74 2c 20 | 66 69 6c 65 2e 4f 70 65 |, text, |file.Ope|
|00002b00| 6e 41 73 50 69 63 74 75 | 72 65 2c 20 66 69 6c 65 |nAsPictu|re, file|
|00002b10| 74 79 70 65 04 65 6c 73 | 65 3b 44 4c 46 69 6e 69 |type.els|e;DLFini|
|00002b20| 73 68 65 64 20 66 69 6c | 65 2c 20 66 69 6c 65 2e |shed fil|e, file.|
|00002b30| 4f 70 65 6e 41 73 54 65 | 78 74 46 69 6c 65 2e 52 |OpenAsTe|xtFile.R|
|00002b40| 65 61 64 41 6c 6c 2c 20 | 6e 69 6c 2c 20 66 69 6c |eadAll, |nil, fil|
|00002b50| 65 74 79 70 65 06 65 6e | 64 20 69 66 01 20 04 65 |etype.en|d if. .e|
|00002b60| 6c 73 65 0e 70 61 73 73 | 6c 61 73 74 3d 66 61 6c |lse.pass|last=fal|
|00002b70| 73 65 22 44 4c 66 69 6e | 69 73 68 65 64 20 66 69 |se"DLfin|ished fi|
|00002b80| 6c 65 2c 20 22 22 2c 20 | 6e 69 6c 2c 20 66 69 6c |le, "", |nil, fil|
|00002b90| 65 74 79 70 65 06 65 6e | 64 20 69 66 00 07 74 65 |etype.en|d if..te|
|00002ba0| 78 74 3d 22 22 07 45 6e | 64 20 53 75 62 0a 46 6f |xt="".En|d Sub.Fo|
|00002bb0| 72 6d 61 74 53 69 7a 65 | 0d 61 6d 74 20 61 73 20 |rmatSize|.amt as |
|00002bc0| 73 69 6e 67 6c 65 06 73 | 74 72 69 6e 67 00 04 0e |single.s|tring...|
|00002bd0| 04 0e 1f 2c 46 75 6e 63 | 74 69 6f 6e 20 46 6f 72 |...,Func|tion For|
|00002be0| 6d 61 74 53 69 7a 65 28 | 61 6d 74 20 61 73 20 73 |matSize(|amt as s|
|00002bf0| 69 6e 67 6c 65 29 20 41 | 73 20 73 74 72 69 6e 67 |ingle) A|s string|
|00002c00| 14 64 69 6d 20 72 65 74 | 2c 20 72 20 61 73 20 73 |.dim ret|, r as s|
|00002c10| 74 72 69 6e 67 00 12 69 | 66 20 6e 6f 74 20 49 6e |tring..i|f not In|
|00002c20| 69 74 65 64 20 74 68 65 | 6e 0e 68 74 74 70 53 6f |ited the|n.httpSo|
|00002c30| 63 6b 65 74 49 6e 69 74 | 06 65 6e 64 20 69 66 00 |cketInit|.end if.|
|00002c40| 10 69 66 20 61 6d 74 3c | 31 30 32 34 20 74 68 65 |.if amt<|1024 the|
|00002c50| 6e 13 72 65 74 75 72 6e | 20 73 74 72 28 61 6d 74 |n.return| str(amt|
|00002c60| 29 2b 22 42 22 19 65 6c | 73 65 69 66 20 61 6d 74 |)+"B".el|seif amt|
|00002c70| 3c 28 31 30 34 38 35 37 | 36 29 20 74 68 65 6e 11 |<(104857|6) then.|
|00002c80| 72 20 3d 20 73 74 72 28 | 61 6d 74 2f 31 30 32 34 |r = str(|amt/1024|
|00002c90| 29 17 69 66 20 69 6e 73 | 74 72 28 72 2c 20 22 2e |).if ins|tr(r, ".|
|00002ca0| 22 29 3e 30 20 74 68 65 | 6e 1b 72 65 74 3d 6e 74 |")>0 the|n.ret=nt|
|00002cb0| 68 46 69 65 6c 64 28 72 | 2c 20 22 2e 22 2c 20 31 |hField(r|, ".", 1|
|00002cc0| 29 2b 22 2e 22 24 72 65 | 74 3d 72 65 74 2b 6c 65 |)+"."$re|t=ret+le|
|00002cd0| 66 74 28 6e 74 68 46 69 | 65 6c 64 28 72 2c 20 22 |ft(nthFi|eld(r, "|
|00002ce0| 2e 22 2c 20 32 29 2c 20 | 31 29 04 65 6c 73 65 0a |.", 2), |1).else.|
|00002cf0| 72 65 74 3d 72 2b 22 2e | 30 22 06 65 6e 64 20 69 |ret=r+".|0".end i|
|00002d00| 66 0b 72 65 74 3d 72 65 | 74 2b 22 4b 22 0a 72 65 |f.ret=re|t+"K".re|
|00002d10| 74 75 72 6e 20 72 65 74 | 04 65 6c 73 65 14 72 20 |turn ret|.else.r |
|00002d20| 3d 20 73 74 72 28 61 6d | 74 2f 31 30 34 38 35 37 |= str(am|t/104857|
|00002d30| 36 29 17 69 66 20 69 6e | 73 74 72 28 72 2c 20 22 |6).if in|str(r, "|
|00002d40| 2e 22 29 3e 30 20 74 68 | 65 6e 1b 72 65 74 3d 6e |.")>0 th|en.ret=n|
|00002d50| 74 68 46 69 65 6c 64 28 | 72 2c 20 22 2e 22 2c 20 |thField(|r, ".", |
|00002d60| 31 29 2b 22 2e 22 24 72 | 65 74 3d 72 65 74 2b 6c |1)+"."$r|et=ret+l|
|00002d70| 65 66 74 28 6e 74 68 46 | 69 65 6c 64 28 72 2c 20 |eft(nthF|ield(r, |
|00002d80| 22 2e 22 2c 20 32 29 2c | 20 31 29 04 65 6c 73 65 |".", 2),| 1).else|
|00002d90| 0a 72 65 74 3d 72 2b 22 | 2e 30 22 06 65 6e 64 20 |.ret=r+"|.0".end |
|00002da0| 69 66 0b 72 65 74 3d 72 | 65 74 2b 22 4d 22 0a 72 |if.ret=r|et+"M".r|
|00002db0| 65 74 75 72 6e 20 72 65 | 74 06 65 6e 64 20 69 66 |eturn re|t.end if|
|00002dc0| 0c 45 6e 64 20 46 75 6e | 63 74 69 6f 6e 08 50 6f |.End Fun|ction.Po|
|00002dd0| 73 74 46 6f 72 6d 00 00 | 00 04 0e 04 0e 10 0e 53 |stForm..|.......S|
|00002de0| 75 62 20 50 6f 73 74 46 | 6f 72 6d 28 29 12 64 69 |ub PostF|orm().di|
|00002df0| 6d 20 63 72 6c 66 20 61 | 73 20 73 74 72 69 6e 67 |m crlf a|s string|
|00002e00| 00 12 69 66 20 6e 6f 74 | 20 49 6e 69 74 65 64 20 |..if not| Inited |
|00002e10| 74 68 65 6e 0e 68 74 74 | 70 53 6f 63 6b 65 74 49 |then.htt|pSocketI|
|00002e20| 6e 69 74 06 65 6e 64 20 | 69 66 00 14 63 72 6c 66 |nit.end |if..crlf|
|00002e30| 3d 63 68 72 28 31 33 29 | 2b 63 68 72 28 31 30 29 |=chr(13)|+chr(10)|
|00002e40| 2a 6d 65 2e 57 72 69 74 | 65 20 22 43 6f 6e 74 65 |*me.Writ|e "Conte|
|00002e50| 6e 74 2d 74 79 70 65 3a | 20 22 2b 50 6f 73 74 45 |nt-type:| "+PostE|
|00002e60| 6e 63 54 79 70 65 2b 63 | 72 6c 66 33 6d 65 2e 57 |ncType+c|rlf3me.W|
|00002e70| 72 69 74 65 20 22 43 6f | 6e 74 65 6e 74 2d 6c 65 |rite "Co|ntent-le|
|00002e80| 6e 67 74 68 3a 20 22 2b | 73 74 72 28 6c 65 6e 28 |ngth: "+|str(len(|
|00002e90| 70 6f 73 74 64 61 74 61 | 29 29 2b 63 72 6c 66 0d |postdata|))+crlf.|
|00002ea0| 27 6d 65 2e 57 72 69 74 | 65 20 22 20 22 0d 6d 65 |'me.Writ|e " ".me|
|00002eb0| 2e 57 72 69 74 65 20 63 | 72 6c 66 11 6d 65 2e 57 |.Write c|rlf.me.W|
|00002ec0| 72 69 74 65 20 50 6f 73 | 74 44 61 74 61 0b 50 6f |rite Pos|tData.Po|
|00002ed0| 73 74 44 61 74 61 3d 22 | 22 0a 4d 65 74 68 6f 64 |stData="|".Method|
|00002ee0| 3d 47 65 74 07 45 6e 64 | 20 53 75 62 09 55 52 4c |=Get.End| Sub.URL|
|00002ef0| 45 6e 63 6f 64 65 24 6e | 61 6d 28 29 20 61 73 20 |Encode$n|am() as |
|00002f00| 73 74 72 69 6e 67 2c 20 | 63 6f 6e 74 65 6e 74 28 |string, |content(|
|00002f10| 29 20 61 73 20 73 74 72 | 69 6e 67 06 73 74 72 69 |) as str|ing.stri|
|00002f20| 6e 67 00 06 0e 06 0e 1b | 82 01 46 75 6e 63 74 69 |ng......|..Functi|
|00002f30| 6f 6e 20 55 52 4c 45 6e | 63 6f 64 65 28 6e 61 6d |on URLEn|code(nam|
|00002f40| 28 29 20 61 73 20 73 74 | 72 69 6e 67 2c 20 63 6f |() as st|ring, co|
|00002f50| 6e 74 65 6e 74 28 29 20 | 61 73 20 73 74 72 69 6e |ntent() |as strin|
|00002f60| 67 29 20 41 73 20 73 74 | 72 69 6e 67 12 64 69 6d |g) As st|ring.dim|
|00002f70| 20 73 2c 61 31 20 61 73 | 20 73 74 72 69 6e 67 11 | s,a1 as| string.|
|00002f80| 64 69 6d 20 72 65 70 20 | 61 73 20 73 74 72 69 6e |dim rep |as strin|
|00002f90| 67 10 64 69 6d 20 69 20 | 61 73 20 69 6e 74 65 67 |g.dim i |as integ|
|00002fa0| 65 72 00 12 69 66 20 6e | 6f 74 20 49 6e 69 74 65 |er..if n|ot Inite|
|00002fb0| 64 20 74 68 65 6e 0e 68 | 74 74 70 53 6f 63 6b 65 |d then.h|ttpSocke|
|00002fc0| 74 49 6e 69 74 06 65 6e | 64 20 69 66 00 16 66 6f |tInit.en|d if..fo|
|00002fd0| 72 20 69 3d 31 20 74 6f | 20 75 62 6f 75 6e 64 28 |r i=1 to| ubound(|
|00002fe0| 6e 61 6d 29 2b 61 31 3d | 72 65 70 6c 61 63 65 61 |nam)+a1=|replacea|
|00002ff0| 6c 6c 28 6e 61 6d 28 69 | 29 2c 22 25 22 2c 22 25 |ll(nam(i|),"%","%|
|00003000| 22 2b 68 65 78 28 61 73 | 63 28 22 25 22 29 29 29 |"+hex(as|c("%")))|
|00003010| 28 61 31 3d 72 65 70 6c | 61 63 65 61 6c 6c 28 61 |(a1=repl|aceall(a|
|00003020| 31 2c 22 26 22 2c 20 22 | 25 22 2b 68 65 78 28 61 |1,"&", "|%"+hex(a|
|00003030| 73 63 28 22 26 22 29 29 | 29 06 73 3d 73 2b 61 31 |sc("&"))|).s=s+a1|
|00003040| 2f 61 31 3d 72 65 70 6c | 61 63 65 61 6c 6c 28 63 |/a1=repl|aceall(c|
|00003050| 6f 6e 74 65 6e 74 28 69 | 29 2c 22 25 22 2c 22 25 |ontent(i|),"%","%|
|00003060| 22 2b 68 65 78 28 61 73 | 63 28 22 25 22 29 29 29 |"+hex(as|c("%")))|
|00003070| 28 61 31 3d 72 65 70 6c | 61 63 65 61 6c 6c 28 61 |(a1=repl|aceall(a|
|00003080| 31 2c 22 26 22 2c 20 22 | 25 22 2b 68 65 78 28 61 |1,"&", "|%"+hex(a|
|00003090| 73 63 28 22 26 22 29 29 | 29 0e 73 3d 73 2b 22 3d |sc("&"))|).s=s+"=|
|000030a0| 22 2b 61 31 2b 22 26 22 | 04 6e 65 78 74 12 73 3d |"+a1+"&"|.next.s=|
|000030b0| 6c 65 66 74 28 73 2c 6c | 65 6e 28 73 29 2d 31 29 |left(s,l|en(s)-1)|
|000030c0| 17 73 3d 72 65 70 6c 61 | 63 65 61 6c 6c 28 73 2c |.s=repla|ceall(s,|
|000030d0| 22 20 22 2c 22 2b 22 29 | 23 72 65 70 3d 22 2c 22 |" ","+")|#rep=","|
|000030e0| 2b 63 68 72 28 31 33 29 | 2b 22 2f 5c 5d 5b 7b 7d |+chr(13)|+"/\][{}|
|000030f0| 60 7e 2d 5f 28 29 2a 5e | 24 23 21 22 00 13 66 6f |`~-_()*^|$#!"..fo|
|00003100| 72 20 69 3d 31 20 74 6f | 20 6c 65 6e 28 72 65 70 |r i=1 to| len(rep|
|00003110| 29 37 73 3d 72 65 70 6c | 61 63 65 61 6c 6c 28 73 |)7s=repl|aceall(s|
|00003120| 2c 6d 69 64 28 72 65 70 | 2c 69 2c 31 29 2c 22 25 |,mid(rep|,i,1),"%|
|00003130| 22 2b 68 65 78 28 61 73 | 63 28 6d 69 64 28 72 65 |"+hex(as|c(mid(re|
|00003140| 70 2c 69 2c 31 29 29 29 | 29 04 6e 65 78 74 00 08 |p,i,1)))|).next..|
|00003150| 72 65 74 75 72 6e 20 73 | 0c 45 6e 64 20 46 75 6e |return s|.End Fun|
|00003160| 63 74 69 6f 6e 0e 68 74 | 74 70 53 6f 63 6b 65 74 |ction.ht|tpSocket|
|00003170| 49 6e 69 74 00 00 00 1b | 00 1b 00 34 14 53 75 62 |Init....|...4.Sub|
|00003180| 20 68 74 74 70 53 6f 63 | 6b 65 74 49 6e 69 74 28 | httpSoc|ketInit(|
|00003190| 29 11 2f 2f 20 68 74 74 | 70 53 6f 63 6b 65 74 20 |).// htt|pSocket |
|000031a0| 31 2e 38 14 2f 2f 20 20 | 42 79 20 44 61 6e 20 56 |1.8.// |By Dan V|
|000031b0| 61 6e 64 65 72 6b 61 6d | 14 2f 2f 20 20 64 61 6e |anderkam|.// dan|
|000031c0| 74 68 65 6f 78 40 61 6f | 6c 2e 63 6f 6d 1c 2f 2f |theox@ao|l.com.//|
|000031d0| 20 20 77 77 77 2e 6e 64 | 2e 65 64 75 2f 7e 6a 76 | www.nd|.edu/~jv|
|000031e0| 61 6e 64 65 72 6b 2f 72 | 62 2f 00 39 2f 2f 20 20 |anderk/r|b/.9// |
|000031f0| 54 68 69 73 20 63 6c 61 | 73 73 20 69 73 20 69 6e |This cla|ss is in|
|00003200| 20 74 68 65 20 70 75 62 | 6c 69 63 20 64 6f 6d 61 | the pub|lic doma|
|00003210| 69 6e 2e 20 46 65 65 6c | 20 66 72 65 65 20 74 6f |in. Feel| free to|
|00003220| 20 6d 61 6b 65 3a 2f 2f | 20 20 20 6d 6f 64 69 66 | make://| modif|
|00003230| 69 63 61 74 69 6f 6e 73 | 20 61 6e 64 20 69 6d 70 |ications| and imp|
|00003240| 72 6f 76 65 6d 65 6e 74 | 73 20 74 6f 20 69 74 2e |rovement|s to it.|
|00003250| 20 49 66 20 79 6f 75 20 | 6d 61 6b 65 20 61 6e 79 | If you |make any|
|00003260| 3a 2f 2f 20 20 20 6d 61 | 6a 6f 72 20 63 68 61 6e |:// ma|jor chan|
|00003270| 67 65 73 2c 20 62 65 20 | 73 75 72 65 20 74 6f 20 |ges, be |sure to |
|00003280| 74 65 6c 6c 20 6d 65 20 | 61 62 6f 75 74 20 74 68 |tell me |about th|
|00003290| 65 6d 2c 20 61 6e 64 20 | 68 6f 77 36 2f 2f 20 20 |em, and |how6// |
|000032a0| 20 79 6f 75 20 6d 61 64 | 65 20 74 68 65 6d 2c 20 | you mad|e them, |
|000032b0| 73 6f 20 74 68 61 74 20 | 49 20 63 61 6e 20 61 64 |so that |I can ad|
|000032c0| 64 20 74 68 65 6d 20 74 | 6f 20 74 68 65 20 6e 65 |d them t|o the ne|
|000032d0| 78 74 1c 2f 2f 20 20 20 | 72 65 76 69 73 69 6f 6e |xt.// |revision|
|000032e0| 20 6f 66 20 74 68 69 73 | 20 63 6c 61 73 73 2e 00 | of this| class..|
|000032f0| 3b 2f 2f 20 20 54 68 69 | 73 20 76 65 72 73 69 6f |;// Thi|s versio|
|00003300| 6e 20 64 6f 65 73 20 6e | 6f 74 20 63 6f 6e 61 74 |n does n|ot conat|
|00003310| 69 6e 20 63 6f 6d 6d 65 | 6e 74 73 20 69 6e 20 6d |in comme|nts in m|
|00003320| 61 6e 79 20 70 61 72 74 | 73 20 6f 66 38 2f 2f 20 |any part|s of8// |
|00003330| 20 20 69 74 2e 20 49 66 | 20 79 6f 75 27 64 20 6c | it. If| you'd l|
|00003340| 69 6b 65 20 74 6f 20 73 | 65 65 20 74 68 65 20 63 |ike to s|ee the c|
|00003350| 6f 6d 6d 65 6e 74 73 20 | 69 6e 20 74 68 65 6d 2c |omments |in them,|
|00003360| 20 6a 75 73 74 3c 2f 2f | 20 20 20 74 65 6c 6c 20 | just<//| tell |
|00003370| 6d 65 2c 20 61 6e 64 20 | 49 27 6c 6c 20 61 64 64 |me, and |I'll add|
|00003380| 20 74 68 65 6d 20 69 6e | 20 74 68 65 20 6e 65 78 | them in| the nex|
|00003390| 74 20 72 65 6c 65 61 73 | 65 2e 20 49 20 74 68 69 |t releas|e. I thi|
|000033a0| 6e 6b 38 2f 2f 20 20 20 | 74 68 61 74 20 63 6f 6d |nk8// |that com|
|000033b0| 6d 65 6e 74 73 20 61 72 | 65 20 75 67 6c 79 20 6c |ments ar|e ugly l|
|000033c0| 6f 6f 6b 69 6e 67 20 28 | 49 20 68 61 74 65 20 72 |ooking (|I hate r|
|000033d0| 65 64 29 2c 20 73 6f 20 | 49 27 64 1c 2f 2f 20 20 |ed), so |I'd.// |
|000033e0| 20 72 61 74 68 65 72 20 | 4e 4f 54 20 70 75 74 20 | rather |NOT put |
|000033f0| 74 68 65 6d 20 69 6e 2e | 00 38 2f 2f 20 20 41 6e |them in.|.8// An|
|00003400| 64 20 62 65 20 73 75 72 | 65 20 74 6f 20 74 65 6c |d be sur|e to tel|
|00003410| 6c 20 6d 65 20 77 68 61 | 74 20 79 6f 75 20 74 68 |l me wha|t you th|
|00003420| 69 6e 6b 20 6f 66 20 68 | 74 74 70 53 6f 63 6b 65 |ink of h|ttpSocke|
|00003430| 74 21 00 13 2f 2f 20 53 | 65 74 20 73 6f 6d 65 20 |t!..// S|et some |
|00003440| 64 61 74 61 2e 2e 2e 00 | 0e 49 66 20 69 6e 69 74 |data....|.If init|
|00003450| 65 64 20 74 68 65 6e 06 | 72 65 74 75 72 6e 06 65 |ed then.|return.e|
|00003460| 6e 64 20 69 66 00 0b 49 | 6e 69 74 65 64 3d 74 72 |nd if..I|nited=tr|
|00003470| 75 65 00 12 43 6c 69 65 | 6e 74 3d 22 52 42 68 74 |ue..Clie|nt="RBht|
|00003480| 74 70 2f 31 35 22 10 4d | 6f 72 65 44 61 74 61 44 |tp/15".M|oreDataD|
|00003490| 65 6c 61 79 3d 33 30 10 | 42 75 66 66 65 72 53 69 |elay=30.|BufferSi|
|000034a0| 7a 65 3d 33 32 30 30 30 | 00 33 2f 2f 20 41 64 64 |ze=32000|.3// Add|
|000034b0| 20 73 6f 6d 65 20 4d 49 | 4d 45 20 74 79 70 65 73 | some MI|ME types|
|000034c0| 20 28 6d 6f 72 65 20 61 | 72 65 20 69 6e 20 74 68 | (more a|re in th|
|000034d0| 65 20 22 66 69 6c 65 20 | 69 6e 66 6f 22 20 2f 2f |e "file |info" //|
|000034e0| 20 64 69 61 6c 6f 67 20 | 75 6e 64 65 72 20 52 42 | dialog |under RB|
|000034f0| 27 73 20 45 64 69 74 20 | 6d 65 6e 75 29 2e 23 41 |'s Edit |menu).#A|
|00003500| 64 64 4d 69 6d 65 20 22 | 69 6d 61 67 65 2f 67 69 |ddMime "|image/gi|
|00003510| 66 22 2c 20 22 47 49 46 | 66 22 2c 20 22 47 4b 4f |f", "GIF|f", "GKO|
|00003520| 4e 22 24 41 64 64 4d 69 | 6d 65 20 22 69 6d 61 67 |N"$AddMi|me "imag|
|00003530| 65 2f 6a 70 65 67 22 2c | 20 22 4a 50 45 47 22 2c |e/jpeg",| "JPEG",|
|00003540| 20 22 47 4b 4f 4e 22 24 | 41 64 64 4d 69 6d 65 20 | "GKON"$|AddMime |
|00003550| 22 74 65 78 74 2f 70 6c | 61 69 6e 22 2c 20 22 54 |"text/pl|ain", "T|
|00003560| 45 58 54 22 2c 20 22 74 | 74 78 74 22 23 41 64 64 |EXT", "t|txt"#Add|
|00003570| 4d 69 6d 65 20 22 74 65 | 78 74 2f 68 74 6d 6c 22 |Mime "te|xt/html"|
|00003580| 2c 20 22 54 45 58 54 22 | 2c 20 22 74 74 78 74 22 |, "TEXT"|, "ttxt"|
|00003590| 29 41 64 64 4d 69 6d 65 | 20 22 76 69 64 65 6f 2f |)AddMime| "video/|
|000035a0| 71 75 69 63 6b 74 69 6d | 65 22 2c 20 22 4d 6f 6f |quicktim|e", "Moo|
|000035b0| 56 22 2c 20 22 54 56 4f | 44 22 23 41 64 64 4d 69 |V", "TVO|D"#AddMi|
|000035c0| 6d 65 20 22 76 69 64 65 | 6f 2f 61 76 69 22 2c 20 |me "vide|o/avi", |
|000035d0| 22 56 66 57 20 22 2c 20 | 22 54 56 4f 44 22 26 41 |"VfW ", |"TVOD"&A|
|000035e0| 64 64 4d 69 6d 65 20 22 | 61 75 64 69 6f 2f 78 2d |ddMime "|audio/x-|
|000035f0| 61 69 66 66 22 2c 20 22 | 41 49 46 46 22 2c 20 22 |aiff", "|AIFF", "|
|00003600| 58 43 50 4c 22 24 41 64 | 64 4d 69 6d 65 20 22 76 |XCPL"$Ad|dMime "v|
|00003610| 69 64 65 6f 2f 6d 70 65 | 67 22 2c 20 22 4d 31 56 |ideo/mpe|g", "M1V|
|00003620| 20 22 2c 20 22 54 56 4f | 44 22 00 12 2f 2f 20 53 | ", "TVO|D"..// S|
|00003630| 65 74 20 75 70 20 47 45 | 54 2f 50 4f 53 54 05 47 |et up GE|T/POST.G|
|00003640| 65 74 3d 31 06 50 6f 73 | 74 3d 32 0a 4d 65 74 68 |et=1.Pos|t=2.Meth|
|00003650| 6f 64 3d 47 65 74 2f 50 | 6f 73 74 45 6e 63 54 79 |od=Get/P|ostEncTy|
|00003660| 70 65 3d 22 61 70 70 6c | 69 63 61 74 69 6f 6e 2f |pe="appl|ication/|
|00003670| 78 2d 77 77 77 2d 66 6f | 72 6d 2d 75 72 6c 65 6e |x-www-fo|rm-urlen|
|00003680| 63 6f 64 65 64 22 00 26 | 2f 2f 20 4c 65 74 20 74 |coded".&|// Let t|
|00003690| 68 65 20 75 73 65 72 20 | 75 73 65 20 74 68 65 20 |he user |use the |
|000036a0| 4f 70 65 6e 20 65 76 65 | 6e 74 20 74 6f 6f 04 4f |Open eve|nt too.O|
|000036b0| 70 65 6e 07 45 6e 64 20 | 53 75 62 09 0a 44 4c 46 |pen.End |Sub..DLF|
|000036c0| 69 6e 69 73 68 65 64 82 | 01 66 20 61 73 20 66 6f |inished.|.f as fo|
|000036d0| 6c 64 65 72 69 74 65 6d | 2c 20 74 78 74 20 61 73 |lderitem|, txt as|
|000036e0| 20 73 74 72 69 6e 67 2c | 20 70 69 63 20 61 73 20 | string,| pic as |
|000036f0| 70 69 63 74 75 72 65 2c | 20 66 69 6c 65 74 79 70 |picture,| filetyp|
|00003700| 65 20 61 73 20 73 74 72 | 69 6e 67 00 05 45 72 72 |e as str|ing..Err|
|00003710| 6f 72 1e 63 6f 64 65 20 | 61 73 20 69 6e 74 65 67 |or.code |as integ|
|00003720| 65 72 2c 20 6d 73 67 20 | 61 73 20 73 74 72 69 6e |er, msg |as strin|
|00003730| 67 00 09 43 61 6e 63 65 | 6c 6c 65 64 00 00 08 4d |g..Cance|lled...M|
|00003740| 6f 72 65 44 61 74 61 3f | 61 6d 74 20 61 73 20 69 |oreData?|amt as i|
|00003750| 6e 74 65 67 65 72 2c 20 | 74 6f 74 61 6c 20 61 73 |nteger, |total as|
|00003760| 20 69 6e 74 65 67 65 72 | 2c 20 70 63 74 20 61 73 | integer|, pct as|
|00003770| 20 73 69 6e 67 6c 65 2c | 20 62 70 73 20 61 73 20 | single,| bps as |
|00003780| 69 6e 74 65 67 65 72 00 | 0f 4c 6f 63 61 74 69 6f |integer.|.Locatio|
|00003790| 6e 43 68 61 6e 67 65 64 | 10 6e 65 77 4c 6f 63 20 |nChanged|.newLoc |
|000037a0| 61 73 20 73 74 72 69 6e | 67 00 0f 52 65 63 65 69 |as strin|g..Recei|
|000037b0| 76 65 64 48 65 61 64 65 | 72 73 00 00 04 4f 70 65 |vedHeade|rs...Ope|
|000037c0| 6e 00 00 0e 50 61 73 73 | 77 6f 72 64 4e 65 65 64 |n...Pass|wordNeed|
|000037d0| 65 64 0f 72 65 61 6c 6d | 20 61 73 20 73 74 72 69 |ed.realm| as stri|
|000037e0| 6e 67 06 73 74 72 69 6e | 67 0b 4c 6f 67 69 6e 46 |ng.strin|g.LoginF|
|000037f0| 61 69 6c 65 64 0d 55 52 | 4c 20 61 73 20 73 74 72 |ailed.UR|L as str|
|00003800| 69 6e 67 07 62 6f 6f 6c | 65 61 6e 07 0c 53 65 6e |ing.bool|ean..Sen|
|00003810| 64 43 6f 6d 70 6c 65 74 | 65 02 10 02 10 06 12 53 |dComplet|e......S|
|00003820| 75 62 20 53 65 6e 64 43 | 6f 6d 70 6c 65 74 65 28 |ub SendC|omplete(|
|00003830| 29 33 2f 2f 20 4d 61 6b | 65 20 73 75 72 65 20 74 |)3// Mak|e sure t|
|00003840| 68 65 20 53 65 6e 64 43 | 6f 6d 70 6c 65 74 65 20 |he SendC|omplete |
|00003850| 65 76 65 6e 74 20 69 73 | 6e 27 74 20 61 76 61 69 |event is|n't avai|
|00003860| 6c 61 62 6c 65 34 2f 2f | 20 69 6e 20 68 74 74 70 |lable4//| in http|
|00003870| 53 6f 63 6b 65 74 20 63 | 6f 6e 74 72 6f 6c 73 2e |Socket c|ontrols.|
|00003880| 20 57 61 79 20 74 6f 6f | 20 6d 61 6e 79 20 70 65 | Way too| many pe|
|00003890| 6f 70 6c 65 20 77 6f 75 | 6c 64 33 2f 2f 20 67 65 |ople wou|ld3// ge|
|000038a0| 74 20 69 74 20 63 6f 6e | 66 75 73 65 64 20 77 69 |t it con|fused wi|
|000038b0| 74 68 20 74 68 65 20 44 | 4c 46 69 6e 69 73 68 65 |th the D|LFinishe|
|000038c0| 64 20 65 76 65 6e 74 2c | 20 77 68 69 63 68 25 2f |d event,| which%/|
|000038d0| 2f 20 73 69 67 6e 69 66 | 69 65 73 20 61 20 76 65 |/ signif|ies a ve|
|000038e0| 72 79 20 64 69 66 66 65 | 72 65 6e 74 20 74 68 69 |ry diffe|rent thi|
|000038f0| 6e 67 2e 20 07 45 6e 64 | 20 53 75 62 05 43 6c 6f |ng. .End| Sub.Clo|
|00003900| 73 65 01 00 01 00 03 0b | 53 75 62 20 43 6c 6f 73 |se......|Sub Clos|
|00003910| 65 28 29 00 07 45 6e 64 | 20 53 75 62 0a 44 72 6f |e()..End| Sub.Dro|
|00003920| 70 4f 62 6a 65 63 74 01 | 00 01 00 03 1f 53 75 62 |pObject.|.....Sub|
|00003930| 20 44 72 6f 70 4f 62 6a | 65 63 74 28 6f 62 6a 20 | DropObj|ect(obj |
|00003940| 41 73 20 44 72 61 67 49 | 74 65 6d 29 00 07 45 6e |As DragI|tem)..En|
|00003950| 64 20 53 75 62 04 4f 70 | 65 6e 01 00 01 00 03 0a |d Sub.Op|en......|
|00003960| 53 75 62 20 4f 70 65 6e | 28 29 00 07 45 6e 64 20 |Sub Open|()..End |
|00003970| 53 75 62 05 45 72 72 6f | 72 22 0e 22 0e 26 0b 53 |Sub.Erro|r".".&.S|
|00003980| 75 62 20 45 72 72 6f 72 | 28 29 2c 64 69 6d 20 74 |ub Error|(),dim t|
|00003990| 65 6d 70 32 20 61 73 20 | 69 6e 74 65 67 65 72 2c |emp2 as |integer,|
|000039a0| 20 53 74 20 61 73 20 54 | 65 78 74 4f 75 74 70 75 | St as T|extOutpu|
|000039b0| 74 53 74 72 65 61 6d 29 | 64 69 6d 20 6d 73 67 2c |tStream)|dim msg,|
|000039c0| 63 72 6c 66 2c 74 65 6d | 70 20 61 73 20 73 74 72 |crlf,tem|p as str|
|000039d0| 69 6e 67 2c 20 62 20 61 | 73 20 62 6f 6f 6c 65 61 |ing, b a|s boolea|
|000039e0| 6e 00 18 63 72 6c 66 20 | 3d 20 63 68 72 28 31 33 |n..crlf |= chr(13|
|000039f0| 29 20 2b 20 63 68 72 28 | 31 30 29 00 18 73 74 3d |) + chr(|10)..st=|
|00003a00| 66 69 6c 65 2e 41 70 70 | 65 6e 64 54 6f 54 65 78 |file.App|endToTex|
|00003a10| 74 46 69 6c 65 0d 73 74 | 2e 57 72 69 74 65 20 74 |tFile.st|.Write t|
|00003a20| 65 78 74 08 73 74 2e 43 | 6c 6f 73 65 07 74 65 78 |ext.st.C|lose.tex|
|00003a30| 74 3d 22 22 00 1a 53 65 | 74 46 69 6c 65 54 79 70 |t=""..Se|tFileTyp|
|00003a40| 65 20 66 69 6c 65 74 79 | 70 65 2c 20 66 69 6c 65 |e filety|pe, file|
|00003a50| 00 1c 53 65 6c 65 63 74 | 20 43 61 73 65 20 6d 65 |..Select| Case me|
|00003a60| 2e 4c 61 73 74 45 72 72 | 6f 72 43 6f 64 65 00 08 |.LastErr|orCode..|
|00003a70| 43 61 73 65 20 31 30 30 | 24 6d 73 67 3d 20 22 20 |Case 100|$msg= " |
|00003a80| 4f 70 65 6e 20 54 72 61 | 6e 73 70 6f 72 74 20 4e |Open Tra|nsport N|
|00003a90| 6f 74 20 49 6e 73 74 61 | 6c 6c 65 64 22 08 43 61 |ot Insta|lled".Ca|
|00003aa0| 73 65 20 31 30 31 26 6d | 73 67 3d 20 22 20 4e 6f |se 101&m|sg= " No|
|00003ab0| 20 43 6f 6e 6e 65 63 74 | 69 6f 6e 20 28 42 61 64 | Connect|ion (Bad|
|00003ac0| 20 4e 61 6d 65 20 6f 72 | 20 49 50 29 22 08 43 61 | Name or| IP)".Ca|
|00003ad0| 73 65 20 31 30 32 19 6d | 73 67 3d 20 22 20 44 6f |se 102.m|sg= " Do|
|00003ae0| 77 6e 6c 6f 61 64 20 46 | 69 6e 69 73 68 65 64 22 |wnload F|inished"|
|00003af0| 08 43 61 73 65 20 31 30 | 33 18 6d 73 67 3d 20 22 |.Case 10|3.msg= "|
|00003b00| 20 53 65 72 76 65 72 20 | 4e 6f 74 20 46 6f 75 6e | Server |Not Foun|
|00003b10| 64 22 08 63 61 73 65 20 | 31 30 34 1a 6d 73 67 3d |d".case |104.msg=|
|00003b20| 20 22 20 43 6f 6e 6e 65 | 63 74 69 6f 6e 20 44 72 | " Conne|ction Dr|
|00003b30| 6f 70 70 65 64 22 04 45 | 6c 73 65 0f 6d 73 67 3d |opped".E|lse.msg=|
|00003b40| 20 22 20 55 6e 6b 6e 6f | 77 6e 22 0a 45 6e 64 20 | " Unkno|wn".End |
|00003b50| 53 65 6c 65 63 74 00 1f | 69 66 20 6d 65 2e 6c 61 |Select..|if me.la|
|00003b60| 73 74 65 72 72 6f 72 63 | 6f 64 65 20 3c 3e 20 31 |sterrorc|ode <> 1|
|00003b70| 30 32 20 74 68 65 6e 1b | 45 72 72 6f 72 20 6d 65 |02 then.|Error me|
|00003b80| 2e 4c 61 73 74 45 72 72 | 6f 72 43 6f 64 65 2c 20 |.LastErr|orCode, |
|00003b90| 6d 73 67 09 43 61 6e 63 | 65 6c 6c 65 64 00 04 65 |msg.Canc|elled..e|
|00003ba0| 6c 73 65 0e 44 6f 46 69 | 6c 65 46 69 6e 69 73 68 |lse.DoFi|leFinish|
|00003bb0| 65 64 00 06 65 6e 64 20 | 69 66 07 45 6e 64 20 53 |ed..end |if.End S|
|00003bc0| 75 62 0d 44 61 74 61 41 | 76 61 69 6c 61 62 6c 65 |ub.DataA|vailable|
|00003bd0| 08 06 08 06 0a 13 53 75 | 62 20 44 61 74 61 41 76 |......Su|b DataAv|
|00003be0| 61 69 6c 61 62 6c 65 28 | 29 0f 64 69 6d 20 74 20 |ailable(|).dim t |
|00003bf0| 61 73 20 73 74 72 69 6e | 67 0c 74 3d 6d 65 2e 52 |as strin|g.t=me.R|
|00003c00| 65 61 64 41 6c 6c 00 16 | 69 66 20 6e 6f 74 20 47 |eadAll..|if not G|
|00003c10| 6f 74 48 65 61 64 65 72 | 73 20 74 68 65 6e 0e 41 |otHeader|s then.A|
|00003c20| 64 64 54 6f 48 65 61 64 | 65 72 73 20 74 04 65 6c |ddToHead|ers t.el|
|00003c30| 73 65 0b 41 64 64 54 6f | 46 69 6c 65 20 74 06 65 |se.AddTo|File t.e|
|00003c40| 6e 64 20 69 66 07 45 6e | 64 20 53 75 62 09 43 6f |nd if.En|d Sub.Co|
|00003c50| 6e 6e 65 63 74 65 64 01 | 00 01 00 03 0f 53 75 62 |nnected.|.....Sub|
|00003c60| 20 43 6f 6e 6e 65 63 74 | 65 64 28 29 00 07 45 6e | Connect|ed()..En|
|00003c70| 64 20 53 75 62 00 00 00 | |d Sub...| |
+--------+-------------------------+-------------------------+--------+--------+